Skip to content

Reject serde uuid and datetime payloads from a newer version - #77012

Open
duan-n2d wants to merge 1 commit into
apache:mainfrom
duan-n2d:reject-newer-serde-uuid-datetime
Open

duan-n2d wants to merge 1 commit into
apache:mainfrom
duan-n2d:reject-newer-serde-uuid-datetime

Conversation

@duan-n2d

@duan-n2d duan-n2d commented Nov 13, 2026 •

Copy link
Copy Markdown

closes: #72636

Registered serde deserializers are expected to refuse a payload stamped with a version newer than the class doing the deserializing, so an older Airflow fails loudly on data written by a newer one instead of misreading it. The other registered serializers already do this; uuid and datetime did not, and the serde framework does not cover for them because its own version check only applies to the attr/dataclass fallback.

Nothing is affected today since both serializers are still at the version they ship with (uuid 1, datetime 2), and older payloads are still read as before. The guard is needed so that the next bump of either __version__ is enforced from the start.

Tests: a parametrized test deserializes a newer-version payload for uuid.UUID, datetime.timedelta and datetime.date through serde.deserialize() and asserts the TypeError.

Verification run locally: I loaded the two edited modules in isolation (Airflow imports stubbed) and exercised them directly. Without the change, newer-version payloads for uuid, timedelta and date are accepted; with it they are rejected, and current versions are still accepted. I did not run the pytest suite or prek locally, so I'm relying on CI for those.


Was generative AI tooling used to co-author this PR?
  • Yes (Claude Code (Sonnet 5.5))

Generated-by: Claude Code (Sonnet 5.5) following the guidelines


  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.

Registered serde deserializers are expected to refuse a payload stamped
with a version newer than the class doing the deserializing, so an older
Airflow fails loudly on data written by a newer one instead of misreading
it. The other registered serializers already do this; uuid and datetime
did not, and the serde framework does not cover for them because its own
version check only applies to the attr/dataclass fallback.

Nothing is affected today since both serializers are still at the version
they ship with. The guard is needed so that the next bump of either
__version__ is enforced from the start.
@boring-cyborg

boring-cyborg Bot commented Nov 13, 2026

Copy link
Copy Markdown

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our prek-hooks will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example Dag that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: [email protected]
    Slack: https://s.apache.org/airflow-slack

@duan-n2d

Copy link
Copy Markdown
Author

I've opened #77012 for this: it adds the same version > __version__ guard that bignum and the other registered serializers use to the uuid and datetime deserializers, with tests that go through the public serde.deserialize() path.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

serde: uuid and datetime serializers accept payloads from a newer version

1 participant