Repository navigation
[airflow-ctl/v0-1-test] Keep airflowctl dags pause/unpause/drain output parseable (#76133) - #76172
Merged
shahar1 merged 1 commit intoOct 31, 2026
Conversation
…ut parseable (apache#76133) The "Dag <operation> successful" and "Further Dag details:" status lines, and the error message on failure, were printed to stdout ahead of the --output data. That made `airflowctl dags pause <dag_id> -o json` produce output that is not valid JSON, so piping it to jq or json.loads failed. Status and error text belong on stderr, matching how the CLI already reports the ambiguous-write warning, so stdout carries only the requested output format. Backport note: this branch has no `dags drain`, so the drain cases of the new tests were dropped; the source change is identical to main. (cherry picked from commit 956d8cd)
shahar1
requested review from
bugraoz93,
dheerajturaga and
potiuk
as code owners
October 31, 2026 19:40
shahar1
enabled auto-merge (squash)
October 31, 2026 19:41
shahar1
disabled auto-merge
October 31, 2026 20:57
shahar1
added a commit
that referenced
this pull request
Nov 19, 2026
…ut parseable (#76133) (#76172) The "Dag <operation> successful" and "Further Dag details:" status lines, and the error message on failure, were printed to stdout ahead of the --output data. That made `airflowctl dags pause <dag_id> -o json` produce output that is not valid JSON, so piping it to jq or json.loads failed. Status and error text belong on stderr, matching how the CLI already reports the ambiguous-write warning, so stdout carries only the requested output format. Backport note: this branch has no `dags drain`, so the drain cases of the new tests were dropped; the source change is identical to main. (cherry picked from commit 956d8cd) Co-authored-by: Shawn Sun <[email protected]>
28 of 67 tasks
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.
Manual backport of #76133 to
airflow-ctl/v0-1-testfor 0.1.6. The automatic backport (run 41203511872) stopped on a conflict inairflow-ctl/tests/airflow_ctl/ctl/commands/test_dag_command.pyand opened nothing.airflowctl dags pause|unpauseprintedDag <operation> successful <dag_id>andFurther Dag details:to stdout ahead of the--outputdata, soairflowctl dags pause my_dag -o json | jq .failed: stdout was not valid JSON. The error message on failure went to stdout as well. These lines now go to stderr, as onmain; stdout carries only the requested output format. In a terminal the visible output does not change; scripts that captured stdout for these status lines will now find them on stderr (exit code unchanged), which may deserve a line in the 0.1.6 release notes.Resolution: the source change is identical to
main(the+/-lines ofdag_command.pymatch). This branch has nodags drain, so the conflict was only in the test file: the two new tests are kept forpause/unpause, thedrainrows of their parametrize lists and themain-only drain tests in the surrounding context were not brought over, andimport jsonwas added. Original author kept.Tested on the branch:
uv run --project airflow-ctl pytest airflow-ctl/tests: 607 passed; the four new test cases fail without the source change. Theairflow-ctl-testsintegration runner merges stderr into stdout, so thedags pause/unpause example_bash_operatorintegration commands are unaffected.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Fable 5.1) following the guidelines