Fresh comstockpostproc install fails on import: PyAthena 4.x requires SQLAlchemy 2 (AttributeError: sqlalchemy.types has no attribute DOUBLE)

Open Beginner friendly
#473 0 comments 0 reactions 0 assignees View on GitHub

@JanghyunJK is already working on this.

Since Nov 6, 2026.

  • #474 by @JanghyunJK — open

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

postprocessing

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.py pins SQLAlchemy==1.4.46.
  • buildstock_query (pinned at 0479759) requires pyathena>=3.19.0 with 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NatLabRockies/ComStock

All issues in NatLabRockies/ComStock

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.