Remove get_double_type from the SQLAlchemy types module - #860
Conversation
With SQLAlchemy 2.0 required (#845), get_double_type only returned types.DOUBLE and nothing in PyAthena calls it. Remove it from pyathena.sqlalchemy.types for the 4.0.0 release; use sqlalchemy.types.DOUBLE instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| from pyathena.sqlalchemy.base import ischema_names | ||
|
|
||
| assert get_double_type() is types.DOUBLE | ||
| def test_double_column_type(): |
There was a problem hiding this comment.
Self-review, rounds one and two (Claude Code)
Scope: git diff 0ba0875c72c702e0b893843d3c50aa98b4a61b8f..20ed3cf385b924e20e9e81982b7cc83ab7b35f2b, covering pyathena/sqlalchemy/types.py and tests/pyathena/sqlalchemy/test_types.py, plus the PR body and commit message.
Round one — behavior: CLEAN.
get_double_typehad no callers left inpyathena/,tests/,docs/, orbenchmarks/(git grep).ischema_names["double"]is stilltypes.DOUBLE, and the replacement test keeps that assertion.typing.Anyhad no other use intypes.py.- Removing the entry from
__all__also drops it fromfrom pyathena.sqlalchemy.types import *. - Validation:
just lintpassed (including license headers); 337 no-AWS tests passed.
Round two — claims and compatibility: CLEAN.
- This is a breaking removal of a public name, which the PR body scopes to 4.0.0 and flags for the release notes, with
sqlalchemy.types.DOUBLEas the replacement. - The "no outside use" claim is limited to what GitHub code search can see (public repositories), and the body says so.
- No generated API docs list the function;
docs/has no autodoc directive for it.
There was a problem hiding this comment.
CI note (Claude Code)
Run 36288246126 at 20ed3cf, attempt 1: test-sqla / run (3.10) reported 589 passed and 4 errors.
- The errors were all in the setup of
InsertBehaviorTest(test_autoclose_on_insert,test_autoclose_on_insert_implicit_returning,test_empty_insert,test_empty_insert_multiple), which share one fixture table. - Athena failed the fixture's Iceberg
CREATE TABLE manual_pkwithAmazonS3Exception: Service Unavailable (Status Code: 503). This is a transient server-side S3 error, unrelated to removing an unused helper. - Attempt 2 of that job passed. All 19 checks now pass; the 3 skipped entries belong to the run from the Draft period.
| @@ -32,19 +32,9 @@ | |||
| "AthenaStruct", | |||
| "AthenaTimestamp", | |||
| "Tinyint", | |||
There was a problem hiding this comment.
Independent review (relayed)
This is a static review of a detached snapshot at the head SHA; the reviewer ran nothing.
- Reviewer: Codex CLI 0.157.0, model
gpt-6-sol, session01a0e0a9-0db2-7402-bf14-8c02ef32bd4b. - Invocation:
codex exec -s read-only --ephemeral. - Scope:
0ba0875c72c702e0b893843d3c50aa98b4a61b8f..20ed3cf385b924e20e9e81982b7cc83ab7b35f2b. - The prompt contained the literal diff and constraints only.
Covered surfaces:
- The two changed files.
- References across code, tests, docs (including
docs/api/*.rst), benchmarks, and scripts. - The DOUBLE reflection path, imports, and the license-header configuration.
Result: CLEAN.
- No
get_double_typereferences remain. - The replacement test checks the mapping used by reflection.
- The test file's missing header is covered by the existing exemption.
The snapshot and PR worktree were unchanged afterwards.
WHAT
get_double_type()frompyathena.sqlalchemy.types, and from its__all__.typing.Anyimport.test_get_double_typewithtest_double_column_type. It keeps the assertion that reflecteddoublecolumns map tosqlalchemy.types.DOUBLE(ischema_names["double"]).WHY
Follow-up to #845 / #858, requested by the maintainer for the 4.0.0 release. This change will not be backported to 3.x.
Since #858 requires SQLAlchemy 2.0,
get_double_type()only returnedtypes.DOUBLE, and nothing in PyAthena calls it.GitHub code search found no use outside this repository. The search covers only public repositories.
Release note (breaking):
pyathena.sqlalchemy.types.get_double_typeis removed. Usesqlalchemy.types.DOUBLE.TEST
Tested commit: 20ed3cf.
just lint: passed, including license headers.tests/pyathena/sqlalchemy/test_types.pystays in the existing header exclusion list inscripts/config/license_headers.toml.uv run pytest tests/pyathena/sqlalchemy/test_types.py tests/pyathena/sqlalchemy/test_compiler.py tests/pyathena/sqlalchemy/test_array.py -k "not Integration": 337 passed.git grep get_double_type: no references remain.Not run locally: AWS integration suites (left to CI). The change removes an unused helper and touches no query path.
🤖 Generated with Claude Code