Skip to content

Conversation

@github-actions
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
kaxil added a commit that referenced this pull request Jun 3, 2025
…ated union definitions (#50688) (#50691)

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>
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