Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

SQLAlchemy 2.0 cleanup: drop_all bind, dead metadata.bind, sql_query read-only

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

@dr-rodriguez is already working on this.

Since Oct 13, 2026.

  • #113 by @dr-rodriguez — open

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

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.

  1. Bug: base.metadata.drop_all() is called with no bind in create_database (both the Felis and non-Felis branches). In SQLAlchemy 2.0, bind is a required argument (MetaData.drop_all(self, bind, tables=None, checkfirst=True)), so create_database(..., drop_tables=True) raises TypeError: MetaData.drop_all() missing 1 required positional argument: 'bind'. No test currently covers drop_tables=True.
  2. Dead code: base.metadata.bind = engine in load_connection does nothing in SQLAlchemy 2.0, since bound metadata was removed.
  3. Docs: sql_query uses engine.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 for drop_tables=True
  • Remove metadata.bind = engine
  • Document sql_query as read-only (docstring + docs)
Dominant language
Python
Stars
12
Forks
5
PR merge metrics
No merged PRs in 30d

Getting set up

Open in Codespaces

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

  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 astrodbtoolkit/AstrodbKit

All issues in astrodbtoolkit/AstrodbKit

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.