Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RemovedIn20Warning #76

Open
sobolevbel opened this issue Nov 28, 2023 · 0 comments
Open

Fix RemovedIn20Warning #76

sobolevbel opened this issue Nov 28, 2023 · 0 comments

Comments

@sobolevbel
Copy link

sobolevbel commented Nov 28, 2023

There's an sqlalchemy deprecation warning in the library. I think it should be fixed.

graphene_sqlalchemy_filter/connection_field.py:259: RemovedIn20Warning: Using strings to indicate column or relationship paths in loader options is deprecated and will be removed in SQLAlchemy 2.0. Please use the class-bound attribute directly. (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)

It seems like self.parent_model_pks is a sequence of strings in the current code:

Load(self.parent_model).load_only(*self.parent_model_pks)

We need to use a new approach with class attributes instead of strings like:

Load(Model).load_only(Model.attr, Model.another_attr)

Versions:
graphene-sqlalchemy-filter==1.13.0
SQLAlchemy==1.3.11

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

No branches or pull requests

1 participant