sqlalchemy-filters
sqlalchemy-filters copied to clipboard
Support SQLAlchemy 2.0
Fixes #83.
I am going to be running these in production soon and I figured I would go ahead and contribute back.
My process was to take the fork from @bodik who did most of the heavy lifting (thanks @bodik!) and then applied fixes to other SQLAlchemy 2.0 issues. My 1 change so far fixes this exception:
except (InvalidRequestError, AttributeError):
# query might not contain columns yet, hence cannot be compiled
# or query might be a sqla2.0 select statement
pass
# also try to infer the models from various internals
> for table_tuple in query._setup_joins + query._legacy_setup_joins:
E AttributeError: 'Select' object has no attribute '_legacy_setup_joins'
Not exactly sure where to go from here, I haven't yet investigated the testing ecosystem of this library but probably we want to get SQLAlchemy 2.0 into the test suite.
@bodik @tomviner what do you think?
Looking at the other open PRs, this also contains the fix to #67 by way of #63 (which @bodik had already applied to their fork).
@tomviner FYI I rebased on the latest master to get the MariaDB pin to pass the GH workflows
@tomviner FYI I rebased on the latest master to get the MariaDB pin to pass the GH workflows
Thanks for your PR, and rebase. The tests for SQLA 1.4 are failing. Would you like to take a look at fixing them?
@tomviner no problem I think I see the issue. Glad we’ve got good tests covering it!
I can also take a look at how to add SQLAlchemy 2 to CI
Is there an ETA on this?
@tomviner is there any work open that I can support with in order to release this?
Any updates?