Uh oh!
There was an error while loading. Please reload this page.
Accept deadline UUIDs in serialized Dag schema - #70579
Closed
rapsealk wants to merge 2 commits into
Closed
Conversation
A Dag with a DeadlineAlert is serialized with its deadline as a list of encoded alert dicts, which is the shape `to_dict` validates against the JSON schema. `SerializedDagModel.write_dag` then rewrites that list to UUIDv7 strings before persisting, so the data actually stored in `serialized_dag.data` no longer conforms to the schema that describes it — anything validating the stored row raises a ValidationError.
ferruzzi
commented
Aug 17, 2026
Contributor
I'm about to merge #70148 which covers the same issue. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A Dag with a
DeadlineAlertis serialized with itsdeadlineas a list of encoded alert dicts — the shapeDagSerialization.to_dictvalidates againstserialization/schema.json.SerializedDagModel.write_dagthen calls_generate_deadline_uuids, which rewrites that list into UUIDv7 strings before persisting. The data actually stored inserialized_dag.datatherefore no longer conforms to the schema that describes it, and anything validating the stored row raisesjsonschema.ValidationError.This adds
list[str]to thedeadlineanyOfso the schema covers the post-rewrite shape alongside the pre-rewrite one, and documents the relationship on_generate_deadline_uuids.Split out of #66269 at review request — that PR mixed this fix with an example Dag and a type-stub fix.
Verification
test_serialized_dag_with_deadline_passes_schema_validationfails withValidationErroronmainand passes with this change.airflow-core/tests/unit/models/test_serialized_dag.py(76 passed) andairflow-core/tests/unit/serialization/(503 passed) are green.prekstatic checks pass.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 5) following the guidelines
Important
🛠️ Maintainer triage note for @rapsealk · by
@potiuk· 2026-08-13 12:55 UTCHelpful heads-up from the maintainers — please address before this PR can be reviewed:
Full list of what we check: Pull Request quality criteria.
The ball is in your court — you've been assigned to this PR. Fix the above, then mark it Ready for review.
Automated triage — may be imperfect; a maintainer takes the next look.