Repository navigation
[v3-4-test] Fix empty audit log dag_id for DAG.cli() subcommands (#73379) - #75388
Merged
Merged
Conversation
) The Dag file is its own entry point on this path, so the parser behind DAG.cli() drops dag_id - there is nothing for the user to type. But action_cli snapshots the namespace and writes the Log row before the handler runs, so every audit row for python my_dag.py dags pause and its five sibling subcommands lands with dag_id NULL: the event cannot be filtered by Dag, and in multi-team mode team_name is resolved from dag_id, so it also drops out of the owning team's view. The back-fills already inside set_is_paused, dag_list_dag_runs and dag_list_jobs cannot cover this. They run after that insert has been committed, and they write to the namespace rather than to the metrics dict that was built from it. Every one of the six subcommands receives the Dag positionally and reads args.dag_id only behind a dag or ... short-circuit, so supplying it changes no control flow - only what the audit row records. (cherry picked from commit 51411ac) Co-authored-by: Y-C <[email protected]> Co-authored-by: Eason09053360 <[email protected]>
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.
The Dag file is its own entry point on this path, so the parser behind
DAG.cli() drops dag_id - there is nothing for the user to type. But
action_cli snapshots the namespace and writes the Log row before the
handler runs, so every audit row for python my_dag.py dags pause and its
five sibling subcommands lands with dag_id NULL: the event cannot be
filtered by Dag, and in multi-team mode team_name is resolved from
dag_id, so it also drops out of the owning team's view.
The back-fills already inside set_is_paused, dag_list_dag_runs and
dag_list_jobs cannot cover this. They run after that insert has been
committed, and they write to the namespace rather than to the metrics
dict that was built from it.
Every one of the six subcommands receives the Dag positionally and
reads args.dag_id only behind a dag or ... short-circuit, so supplying
it changes no control flow - only what the audit row records.
(cherry picked from commit 51411ac)
Co-authored-by: Y-C [email protected]
Co-authored-by: Eason09053360 [email protected]