Repository navigation
Fix SQLAlchemy 2.0 issues in create_database and document sql_query - #113
Open
dr-rodriguez wants to merge 1 commit into
Open
dr-rodriguez wants to merge 1 commit into
dr-rodriguez wants to merge 1 commit into
Conversation
- Pass bind=engine to metadata.drop_all(); drop_tables=True previously raised TypeError under SQLAlchemy 2.0 - Remove no-op metadata.bind assignment in load_connection - Document sql_query as read-only (writes are rolled back) - Add test for create_database(drop_tables=True) Closes astrodbtoolkit#112 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #112. Related to #103.
Changes
create_database: passbind=enginetometadata.drop_all()in both the Felis and non-Felis branches. Under SQLAlchemy 2.0,drop_tables=Truepreviously raisedTypeError: MetaData.drop_all() missing 1 required positional argument: 'bind'.load_connection: remove thebase.metadata.bind = engineassignment, which does nothing in SQLAlchemy 2.0.sql_query: the docstring anddocs/index.rstnow say it is for read-only queries; INSERT, UPDATE and DELETE statements are rolled back.test_drop_tables, which coversdrop_tables=Truefor both branches.Testing
astrodb.py,test_drop_tablesfails with theTypeError; with this change it passes.🤖 Generated with Claude Code