-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Pickle/Unpickle cannot reconstitute query if it contains func.row_number().over() #5644
Comments
hi there - serialization of queries via pickle is not expected to work. there's an extension called serializer which is here: https://github.com/sqlalchemy/sqlalchemy/blob/master/lib/sqlalchemy/ext/serializer.py and interestingly appears to not be in the documentation build, which is surprising, but might help here. I can look into this specific thing but I can't spend a lot of time on it. overall though I don't think there are good uses cases for serializing ORM queries. |
Hi, it doesn't work via the ext.serializer.dumps/loads either - similar traceback. We run quite a number of queries through the pickle/unpickle and only seem to get errors with queries containing the
|
Mike Bayer has proposed a fix for this issue in the master branch: Repair reduction in Over https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/2300 |
Mike Bayer has proposed a fix for this issue in the rel_1_3 branch: Repair reduction in Over https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/2301 |
sure. fix will be in 1.3.20. however we dont have a testing strategy for pickling right now so you are working in an area of functionality that's not fully supported. |
Nice, thanks for the fix! I'm sure we can look at using the serializer if it achieves the same outcome. |
i think the serializer is not in the docs because i want to be able to remove it at some point even though ive not made plans to do so. the problem with pickling is that the use cases for why this is needed aren't clear. does your application have Table objects in it? if you deserialize a select() , do those have Table objects in them also? you'd want these to use the Table objects in your app already. that's what the serializer extension does. but this use case doesnt come up b.c. it's not clear why folks need to pickle expressions in the first place. |
Describe the bug
A RecursionError can be observed when trying to unpickle a pickled query that contains
func.row_number().over()
Expected behavior
Expect the query to unpickle successfully
To Reproduce
The script below should show the problem immediately
Error
Versions.
The text was updated successfully, but these errors were encountered: