Skip to content

Return DOUBLE type for double columns in SQLAlchemy 2.0+#648

Merged
laughingman7743 merged 1 commit intomasterfrom
feature/double-type-sqlalchemy2
Jan 31, 2026
Merged

Return DOUBLE type for double columns in SQLAlchemy 2.0+#648
laughingman7743 merged 1 commit intomasterfrom
feature/double-type-sqlalchemy2

Conversation

@laughingman7743
Copy link
Member

Summary

  • Add get_double_type() helper function in pyathena/sqlalchemy/types.py that returns types.DOUBLE for SQLAlchemy 2.0+ and falls back to types.FLOAT for earlier versions
  • Update ischema_names in pyathena/sqlalchemy/base.py to use the helper function for "double" type mapping
  • Update existing tests to use get_double_type() for version-compatible assertions
  • Add unit test for the new helper function
  • Add .env to .gitignore and document .env usage for local testing in CLAUDE.md

Test plan

  • make chk passes
  • test_types.py - 29 tests passed
  • test_reflect_table_include_columns - passed
  • test_get_column_type - passed
  • test_numeric_type_variants - passed

Closes #647

@laughingman7743 laughingman7743 force-pushed the feature/double-type-sqlalchemy2 branch 4 times, most recently from e2ecf3b to 7976cb5 Compare January 31, 2026 09:17
Add get_double_type() helper function that returns types.DOUBLE for
SQLAlchemy 2.0+ and falls back to types.FLOAT for earlier versions.

This fixes the issue where inspector.get_columns() returns FLOAT()
instead of DOUBLE() for columns with 'double' data type.

Changes:
- Add get_double_type() helper in pyathena/sqlalchemy/types.py
- Update ischema_names in pyathena/sqlalchemy/base.py
- Update tests for version-compatible assertions
- Add .env to .gitignore and document usage in CLAUDE.md
- Fix import sorting in benchmark file

Closes #647

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@laughingman7743 laughingman7743 force-pushed the feature/double-type-sqlalchemy2 branch from 7976cb5 to b91e0f5 Compare January 31, 2026 09:23
@laughingman7743 laughingman7743 marked this pull request as ready for review January 31, 2026 09:43
@laughingman7743 laughingman7743 merged commit 9d65171 into master Jan 31, 2026
5 checks passed
@laughingman7743 laughingman7743 deleted the feature/double-type-sqlalchemy2 branch January 31, 2026 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

inspector.get_columns() returns float for double data type

1 participant