Fresh comstockpostproc install fails on import: PyAthena 4.x requires SQLAlchemy 2 (AttributeError: sqlalchemy.types has no attribute DOUBLE)
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python, sqlalchemy
- Domain
- build-system
Research direction
Start with postprocessing/setup.py and inspect the install_requires entries alongside the reported SQLAlchemy and PyAthena versions. Add the proposed PyAthena upper bound, then verify a fresh environment installs a compatible version and import comstockpostproc succeeds.
Written by the indexing model from the issue text.
Description
Symptom
After a fresh install of the comstockpostproc environment (following postprocessing/README), importing the package fails:
>>> import comstockpostproc as cspp
File ".../comstockpostproc/comstock.py", line 32, in <module>
from buildstock_query import BuildStockQuery
File ".../site-packages/buildstock_query/query_core.py", line 6, in <module>
from pyathena.sqlalchemy.base import AthenaDialect
File ".../site-packages/pyathena/sqlalchemy/base.py", line 79, in <module>
"double": types.DOUBLE,
AttributeError: module 'sqlalchemy.types' has no attribute 'DOUBLE'
Cause
postprocessing/setup.pypinsSQLAlchemy==1.4.46.buildstock_query(pinned at0479759) requirespyathena>=3.19.0with no upper bound.- pip therefore installs the latest PyAthena (4.x, e.g. 4.2.1), which uses
sqlalchemy.types.DOUBLE. That type only exists in SQLAlchemy 2.x.
Any new install hits this while PyAthena 4.x is the latest release. Existing environments built before PyAthena 4 aren't affected until someone reinstalls. Both main and ccaradon/sdr_2026_r1 have the same pins.
Workaround
In the comstockpostproc environment:
python -m pip install "pyathena>=3.19.0,<4"
This installs PyAthena 3.40.0, and import comstockpostproc then works with SQLAlchemy 1.4.46.
Proposed fix
Add an upper bound on PyAthena to install_requires in postprocessing/setup.py:
'pyathena>=3.19.0,<4',
A longer-term option is moving to SQLAlchemy 2.x, which depends on buildstock_query and sqlalchemy-views supporting it.
🤖 Generated with Claude Code
- Dominant language
- Ruby
- Stars
- 54
- Forks
- 28
- Avg merge
- 3d 23h
- Merged PRs (30d)
- 5
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NatLabRockies/ComStock
-
Sampling broken with dependency changesMay be free again @asparke2 claimed this 93 days ago, and no pull request is open. Openbug
NatLabRockies/ComStock#462 · 1 assignee ·
-
Update S3 workgroup in gap model queriesMay be free again @eringold claimed this 270 days ago, and no pull request is open. Open
NatLabRockies/ComStock#453 · 1 assignee ·
-
postprocessing
Difficulty 3/5 1-2 days Newbie friendliness 35/100
NatLabRockies/ComStock#452 ·
-
Postprocessing setup and READMEs out of dateMay be free again @ChristopherCaradonna claimed this 275 days ago, and no pull request is open. Openpostprocessing
NatLabRockies/ComStock#451 · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
NatLabRockies/ComStock#445 ·
All issues in NatLabRockies/ComStock
Similar issues
-
Visual COBOL: missing 11.0 and 12.0, and 9.0 date differs from Rocket Software's lifecycle pageOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
endoflife-date/endoflife.date#11561 ·
Maintainers usually reply within 1 day
-
internal
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Kong/developer.konghq.com#7954 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
No Ruby in CIOpenarea: core area: devops lane: strong-agent priority: P2 roadmap size: S type: removal type: task
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
arminazimi/slipway#1216 ·
Maintainers usually reply within 1 day
-
bug javascript
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day