Content-Length: 262595 | pFad | http://github.com/apache/airflow/pull/50691

45 [v3-0-test] Fix Pydantic ``ForwardRef`` error by reordering discriminated union definitions (#50688) by github-actions[bot] · Pull Request #50691 · apache/airflow · GitHub
Skip to content

[v3-0-test] Fix Pydantic ForwardRef error by reordering discriminated union definitions (#50688) #50691

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 20, 2025

Conversation

github-actions[bot]
Copy link

In some rare cases, the DAG parse subprocess (DagFileProcessorProcess) could raise a PydanticUserError related to unresolved ForwardRefs in the discriminated union ToDagProcessor.

This was caused by TypeAdapter[ToDagProcessor] being instantiated before DagFileParseRequest was defined. While this is not always reproducible, it can happen in forked subprocesses depending on import order.

This change moves the union definitions (ToDagProcessor, ToManager) after the relevant Pydantic models are declared, ensuring all references are fully resolved at definition time.

closes #50530
(cherry picked from commit 672ec99)

Co-authored-by: Kaxil Naik kaxilnaik@gmail.com

…ated union definitions (#50688)

In some rare cases, the DAG parse subprocess (`DagFileProcessorProcess`) could raise a `PydanticUserError` related to unresolved ForwardRefs in the discriminated union ToDagProcessor.

This was caused by `TypeAdapter[ToDagProcessor]` being instantiated before `DagFileParseRequest` was defined. While this is not always reproducible, it can happen in forked subprocesses depending on import order.

This change moves the union definitions (`ToDagProcessor`, `ToManager`) after the relevant Pydantic models are declared, ensuring all references are fully resolved at definition time.

closes #50530
(cherry picked from commit 672ec99)

Co-authored-by: Kaxil Naik <kaxilnaik@gmail.com>
@kaxil kaxil force-pushed the backport-672ec99-v3-0-test branch from 5ed715b to b9f9aa5 Compare May 19, 2025 14:55
@kaxil kaxil merged commit 7c599c7 into v3-0-test May 20, 2025
51 checks passed
@kaxil kaxil deleted the backport-672ec99-v3-0-test branch May 20, 2025 19:50
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.

2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/apache/airflow/pull/50691

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy