You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "rapsealk (via GitHub)" <gi...@apache.org> on 2026/07/28 08:40:13 UTC

[PR] feat: Accept deadline UUIDs in serialized Dag schema [airflow]

rapsealk opened a new pull request, #70579:
URL: https://github.com/apache/airflow/pull/70579

   A Dag with a `DeadlineAlert` is serialized with its `deadline` as a list of encoded alert dicts — the shape `DagSerialization.to_dict` validates against `serialization/schema.json`. `SerializedDagModel.write_dag` then calls `_generate_deadline_uuids`, which rewrites that list into UUIDv7 strings *before* persisting. The data actually stored in `serialized_dag.data` therefore no longer conforms to the schema that describes it, and anything validating the stored row raises `jsonschema.ValidationError`.
   
   ```
   jsonschema.exceptions.ValidationError: ['019fa7db-318a-710c-ace6-4c2edb33f573'] is not valid under any of the given schemas
   Failed validating 'anyOf' in schema['allOf'][0]['properties']['dag']['properties']['deadline']
   ```
   
   This adds `list[str]` to the `deadline` `anyOf` so 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
   
   - New regression test `test_serialized_dag_with_deadline_passes_schema_validation` fails with `ValidationError` on `main` and passes with this change.
   - `airflow-core/tests/unit/models/test_serialized_dag.py` (76 passed) and `airflow-core/tests/unit/serialization/` (503 passed) are green.
   - `prek` static checks pass.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 5)
   
   Generated-by: Claude Code (Opus 5) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Accept deadline UUIDs in serialized Dag schema [airflow]

Posted by "ferruzzi (via GitHub)" <gi...@apache.org>.
ferruzzi commented on PR #70579:
URL: https://github.com/apache/airflow/pull/70579#issuecomment-5321006581

   I'm about to merge https://github.com/apache/airflow/pull/70148 which covers the same issue.  


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Accept deadline UUIDs in serialized Dag schema [airflow]

Posted by "ferruzzi (via GitHub)" <gi...@apache.org>.
ferruzzi closed pull request #70579: Accept deadline UUIDs in serialized Dag schema
URL: https://github.com/apache/airflow/pull/70579


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org