Sriniketh24 commented on PR #67141: URL: https://github.com/apache/airflow/pull/67141#issuecomment-4526448792
Reworked the approach based on the CI failures: **Previous approach** (broken): Changed `_LazySafeSerializer` from msgpack to JSON encoding. This caused `TypeError: memoryview: a bytes-like object is required, not 'str'` in compat tests because JSON bytes (valid UTF-8) were being coerced to `str` somewhere in the flask-session → SQLAlchemy pipeline, breaking the `LargeBinary` column insert. **New approach**: Leave the database serializer (`_LazySafeSerializer`) unchanged — msgpack is correct for `LargeBinary` columns. Instead, fix the actual bug site: override `save_session()` in `AirflowSecureCookieSessionInterface` to wrap `response.set_cookie()` with bytes-to-str coercion, since Werkzeug 3.0+ [removed bytes support in `dump_cookie()`](https://github.com/pallets/werkzeug/commit/5ff0a573f4b78d9724f1f063fb058fd6bc76b24d). --- Drafted-by: Claude Code (Opus 4.6); reviewed by @Sriniketh24 before posting -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
