SQLAlchemy 2.0 cleanup: drop_all bind, dead metadata.bind, sql_query read-only
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python, sqlalchemy
- Domain
- databases, documentation
Research direction
Start in the create_database function, which calls base.metadata.drop_all() without bind in both the Felis and non-Felis branches, then in load_connection where base.metadata.bind = engine sits, and in sql_query. Reproduce the bug by calling create_database(..., drop_tables=True) to see the TypeError. Done means that call runs without error, a new test covers drop_tables=True, the dead metadata.bind line is gone, and sql_query is documented as read-only.
Written by the indexing model from the issue text.
Description
Issue authored by Claude (Opus 5.5).
I found these while auditing for #103.
- Bug:
base.metadata.drop_all()is called with nobindincreate_database(both the Felis and non-Felis branches). In SQLAlchemy 2.0,bindis a required argument (MetaData.drop_all(self, bind, tables=None, checkfirst=True)), socreate_database(..., drop_tables=True)raisesTypeError: MetaData.drop_all() missing 1 required positional argument: 'bind'. No test currently coversdrop_tables=True. - Dead code:
base.metadata.bind = engineinload_connectiondoes nothing in SQLAlchemy 2.0, since bound metadata was removed. - Docs:
sql_queryusesengine.connect()without a commit. Any INSERT/UPDATE/DELETE sent through it is silently rolled back, so it should be documented as read-only.
Proposed fixes:
-
drop_all()→drop_all(bind=engine)(2 places), plus a test fordrop_tables=True - Remove
metadata.bind = engine - Document
sql_queryas read-only (docstring + docs)
- Dominant language
- Python
- Stars
- 12
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No 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 astrodbtoolkit/AstrodbKit
-
Nulls and load_tablePossibly taken @dr-rodriguez claimed this today. Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
astrodbtoolkit/AstrodbKit#109 · 1 comment · 1 assignee ·
-
Remove `wcs1d_multispec` reader.May be free again @dr-rodriguez claimed this 336 days ago, and no pull request is open. Open
astrodbtoolkit/AstrodbKit#105 · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
astrodbtoolkit/AstrodbKit#104 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
astrodbtoolkit/AstrodbKit#101 · 1 comment ·
-
enhancement good first issue
Difficulty 3/5 1-2 days Newbie friendliness 45/100
astrodbtoolkit/AstrodbKit#100 · 1 comment ·
All issues in astrodbtoolkit/AstrodbKit
Similar issues
-
[Bug]: LangGraph Store sync put bypasses namespace validationPossibly taken @ktz03 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
volcengine/OpenViking#6050 ·
Maintainers usually reply within 1 day
-
[Bug]: Streamed /v1/chat/completions sends unredacted agent error text (keys) in the final chunkPossibly taken @rodricksz4h5 claimed this today. Openarea/streaming comp/gateway P2 type/security
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NousResearch/hermes-agent#138245 ·
Maintainers usually reply within 1 day
-
[oblt-aw][autodoc] Update user onboarding guide for mandatory trigger CODEOWNERS stepPossibly taken @github-actions claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
correction metadata
Difficulty 2/5 Under an hour Newbie friendliness 68/100
acl-org/acl-anthology#10378 · 1 comment ·
Maintainers usually reply within 1 day
-
cloudtrail_multi_region_enabled_logging_management_events fails when the advanced event selector has a custom namePossibly taken @12YYCCYY16 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
prowler-cloud/prowler#13033 ·
Maintainers usually reply within 1 day