airflow
airflow copied to clipboard
Add support for flask-session 0.8.0+
Opening this PR for running CI tests. Changes are as follows :
- import path changed
- db renamed to client
- encode method changed to dumps
- decode method changed to loads
- flask-session creates session table by default so migration is removed to avoid duplicate table error.
Issues :
- serialization tests fail since flask_session switched to msgpack by default from pickle which causes objects that were compatible with pickle like flask's flash message objects to fail in the test since msgpack doesn't know how to serialize them.
- It seems after the release of 0.8.0 the methods encode/decode were again changed to dumps/loads in https://github.com/pallets-eco/flask-session/commit/0c22ec67b4ccfd210f2ac94a70b39e6d46497d5b . This will cause an issue moving to 0.8.0+ since there is no compatibility layer between two methods.
closes: #36897 related: #36897
serialization tests fail since flask_session switched to msgpack by default from pickle which causes objects that were compatible with pickle like flask's flash message objects to fail in the test since msgpack doesn't know how to serialize them.
I tried changing the serializer to pickle but one of the objects has a function defined inside __init__ which cannot be serialized by pickle. I have implemented a custom serializer extending it to serialize and deserialize markup objects.
https://jcristharif.com/msgspec/extending.html#defining-a-custom-extension-messagepack-only
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.