Skip to content

Conversation

@chalupaul
Copy link

Found a few errors when attempting to use sqlalchemy 2.0.44 and alembic 1.17.1.

  1. Added text() to raw query so it is bindable. Was throwing errors that the object passed was "not bindable".
  2. has_table() relies on extraction of the error code to know whether or not it needs to create a table. Thus the existing error handler (that returned the whole message) was causing an unknown exception. Effectively, alembic would never create its version table during the first upgrade. I Rewrote the function with proper filtering to return expected error code. There's a sql_state in there if we need it in the future (commented otherwise).
  3. ruff had some older syntax and config so I updated that to newest standards.

has_table() relies on valid exception handling. Rewrote with proper filtering to return expected error code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant