sqlalchemy-filters icon indicating copy to clipboard operation
sqlalchemy-filters copied to clipboard

Support SQLAlchemy 2.0

Open phillipuniverse opened this issue 1 year ago • 7 comments

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?

phillipuniverse avatar Jan 06 '24 20:01 phillipuniverse

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).

phillipuniverse avatar Jan 06 '24 21:01 phillipuniverse

@tomviner FYI I rebased on the latest master to get the MariaDB pin to pass the GH workflows

phillipuniverse avatar Jan 09 '24 15:01 phillipuniverse

@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 avatar Jan 14 '24 17:01 tomviner

@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

phillipuniverse avatar Jan 14 '24 18:01 phillipuniverse

Is there an ETA on this?

trbtm avatar Feb 06 '24 12:02 trbtm

@tomviner is there any work open that I can support with in order to release this?

trbtm avatar Apr 12 '24 13:04 trbtm

Any updates?

ConfusedCoder556 avatar Jul 03 '24 15:07 ConfusedCoder556