Repository navigation
Parse native Lang-SDK Dags in a Dag bag - #74043
Merged
jason810496 merged 7 commits intoOct 5, 2026
Merged
jason810496 merged 7 commits into
jason810496 merged 7 commits into
Conversation
This was referenced Oct 1, 2026
jason810496
added this pull request to stack #74044
October 1, 2026 15:18
kaxil
reviewed
Oct 1, 2026
jason810496
force-pushed
the
jason/lang-sdk-e2e/03e-lang-sdk-dag-bag
branch
2 times, most recently
from
October 2, 2026 04:07
64b7eff to
bd89a18
Compare
jason810496
force-pushed
the
jason/lang-sdk-e2e/03e-lang-sdk-dag-bag
branch
from
October 2, 2026 05:44
bd89a18 to
96f2076
Compare
pierrejeambrun
force-pushed
the
jason/lang-sdk-e2e/03e-lang-sdk-dag-bag
branch
from
October 2, 2026 09:00
96f2076 to
6fea2b4
Compare
jason810496
force-pushed
the
jason/lang-sdk-e2e/03e-lang-sdk-dag-bag
branch
from
October 2, 2026 11:41
6fea2b4 to
6c3ae5d
Compare
jason810496
commented
Oct 2, 2026
jason810496
left a comment
Member
Author
There was a problem hiding this comment.
Thanks for the review.
jason810496
marked this pull request as ready for review
October 2, 2026 13:59
jason810496
requested review from
amoghrajesh,
gopidesupavan and
jscheffl
as code owners
October 3, 2026 17:59
jason810496
force-pushed
the
jason/lang-sdk-e2e/03e-lang-sdk-dag-bag
branch
from
October 3, 2026 17:59
964f50b to
fe5a99c
Compare
jason810496
added this pull request to stack #74170
October 3, 2026 17:59
jason810496
force-pushed
the
jason/lang-sdk-e2e/03e-lang-sdk-dag-bag
branch
from
October 4, 2026 01:06
fe5a99c to
29de12f
Compare
jason810496
force-pushed
the
jason/lang-sdk-e2e/03e-lang-sdk-dag-bag
branch
from
October 4, 2026 08:52
29de12f to
1724f56
Compare
jason810496
force-pushed
the
jason/lang-sdk-e2e/03e-lang-sdk-dag-bag
branch
from
October 5, 2026 04:53
1724f56 to
abfadb4
Compare
jason810496
force-pushed
the
jason/lang-sdk-e2e/03e-lang-sdk-dag-bag
branch
2 times, most recently
from
October 5, 2026 09:12
471491d to
77a24d4
Compare
pierrejeambrun
approved these changes
Oct 5, 2026
pierrejeambrun
left a comment
Member
There was a problem hiding this comment.
Beside the is_ready issues that cascade from previous PR.
Looks good.
CoordinatorDagImporter.import_definition now runs the same LangSDKDagFileProcessorProcess as the Dag processor, for a Dag bag such as a CLI command's, and returns each Dag as a SerializedLangSDKDAG. A Dag bag has no API client, so the runtime's requests get an error there. The Dag bag skips the SDK-only checks and cluster policies for such a Dag, sync_bag_to_db does not store its Dags, and CLI commands that run a Dag refuse it. The recorded TypeScript and Java runtime payloads must pass validate_serialized_dag.
A Dag bag parses a Lang-SDK file outside the Dag processor, where there is no API client. Make the client optional on the base Dag file processor, which answers each request that needs it with an error, and add LangSDKDagFileProcessorProcess.run() to parse one file and wait for the result.
DagImportResult.dags stays list[DAG], and the coordinator importer goes back to reporting that only the Dag processor parses its files. A Dag bag built with parse_lang_sdk_files=True runs the file's runtime itself and bags each Dag as a SerializedDAG, checked only for a duplicate id. Without it, as for dags reserialize and DAG.test(), such a file stays a cheap import error. get_bagged_dag takes allow_lang_sdk_dag to pass it on. All runtime import errors of a file are joined into one message, since the bag keeps one error per file.
tasks list only prints the ids in dag.tasks, which a SerializedDAG has, so it asks get_bagged_dag to parse native Lang-SDK files too.
A Dag bag can now hold a SerializedDAG, so the Airflow 2 branch that calls create_dagrun on a bagged Dag needs union-attr ignored too.
A Dag bag parses a Lang-SDK file with no parse log, so the base allows none. DagFileProcessorProcess still requires the handle and the client.
Subclasses no longer check logger_filehandle for None before closing it. DagFileProcessorProcess drops its own declaration of the attribute and inherits the default.
jason810496
force-pushed
the
jason/lang-sdk-e2e/03e-lang-sdk-dag-bag
branch
from
October 5, 2026 10:41
77a24d4 to
e88645e
Compare
jason810496
commented
Oct 5, 2026
jason810496
left a comment
Member
Author
There was a problem hiding this comment.
Thanks for the review
This was referenced Oct 5, 2026
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 free
to 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.
Stack (bottom to top): #74042, #74035, #74043, #74036, #74037, #73845, #73846, #73847
Why
CLI commands and
airflow dags reserializeload Dags through a Dag bag, which cannot parse a native Lang-SDK Dag file yet.What changes
DagBag(parse_lang_sdk_files=True)runs a coordinator-claimed file with the sameLangSDKDagFileProcessorProcessas the Dag processor, with the same fill and validation, and bags each Dag as theSerializedDAGthe scheduler loads. The Dag importer does not parse it. A Dag bag has no API client, so a runtime request other than the parse result orMaskSecretgets an error.BaggedDAG = DAG | SerializedDAG. It keeps its duplicate id check for a native Dag and skips the SDK-only checks and cluster policies.sync_bag_to_dbdoes not store a native Dag: the Dag processor does.airflow tasks listlists a native Dag's tasks.dags test,tasks testandtasks renderdo not parse a native Dag, and the Python processor refuses its callbacks.validate_serialized_dag.Deviations from #71929
SerializedDAG, not anairflow.sdk.DAG.Was generative AI tooling used to co-author this PR?