You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Eason09053360 (via GitHub)" <gi...@apache.org> on 2026/09/08 01:57:34 UTC

[PR] Fix airflowctl commands crashing instead of printing their result [airflow]

Eason09053360 opened a new pull request, #72675:
URL: https://github.com/apache/airflow/pull/72675

   Five auto-generated `airflowctl` commands crashed with a raw traceback instead of printing their result:
   
   ```console
   $ airflowctl connections test --connection-id my_conn --conn-type http
   Traceback (most recent call last):
     ...
     File "airflowctl/ctl/cli_config.py", line 926, in _get_func
       output=args.output,
              ^^^^^^^^^^^
   AttributeError: 'Namespace' object has no attribute 'output'
   ```
   
   `CommandFactory` generates every `airflowctl` command from the operations layer, and each generated
   command finishes by printing through `args.output`. But `--output` was only declared for commands
   whose method name started with one of ten CRUD verbs (`list`, `get`, `create`, …). The commands whose
   verb was not on that list never got the flag declared, so argparse never put `output` on the
   namespace, and they died in the printer — *after* their HTTP request had already been sent and
   applied server-side, so the user sees a crash for an operation that actually succeeded.
   
   Affected commands:
   
   | Command | Operation |
   |---|---|
   | `airflowctl assets materialize` | `AssetsOperations.materialize` |
   | `airflowctl backfill pause` | `BackfillOperations.pause` |
   | `airflowctl backfill unpause` | `BackfillOperations.unpause` |
   | `airflowctl backfill cancel` | `BackfillOperations.cancel` |
   | `airflowctl connections test` | `ConnectionsOperations.test` |
   
   Rather than adding the five missing verbs to the list, this drops the condition for `--output`
   entirely: there is no generated command that does not print, so the distinction the whitelist tried
   to draw does not exist. Guessing by verb prefix is also wrong in both directions — an operation named
   `settings` would have matched `set` by accident.
   
   `-e/--env` deliberately keeps the existing whitelist rather than riding along. Nothing reads
   `args.env` for generated commands (only `auth login` / `auth token` do), so widening it would replace
   today's honest `unrecognized argument` error with silent acceptance of an environment the command
   then ignores — running against production credentials while the user believes they targeted staging.
   Making `--env` actually work is tracked in #70519.
   
   ### Tests
   
   - `test_every_generated_command_accepts_the_output_flag` — asserts no generated command is missing
     `--output`. Without the fix it fails listing exactly the five commands above. This is the guard
     that stops the whitelist coming back.
   - `test_connections_test_reaches_the_printer` — drives `connections test` through the real
     `cli_parser.get_parser()` end to end. Without the fix it raises the `AttributeError` above.
   
   Both were confirmed to fail with the source change reverted. Full `airflow-ctl` suite: 389 passed.
   
   ### Note for reviewers
   
   `generate-airflowctl-help-images` was skipped locally (it needs Docker). Its hashes already drift on
   an unmodified `main` — I verified the identical eight groups differ with and without this change — so
   regenerating the SVGs here would only pull unrelated churn into this PR. Happy to add a commit if CI
   disagrees.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 5)
   
   Generated-by: Claude Code (Opus 5) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix airflowctl commands crashing instead of printing their result [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #72675:
URL: https://github.com/apache/airflow/pull/72675#issuecomment-5839065498

   Hello @Eason09053360 - thank you for your contributions to Apache Airflow!
   
   The Airflow community has introduced a limit of **5 open pull requests at a time** for contributors without write access to the repository. You currently have 33 open pull requests, so - as a one-time step of introducing the limit - we closed the ones where maintainers have not engaged yet:
   
   * #70935 - Return only the latest Dag version from iter_all_latest_version_dags
   * #72145 - Fix airflow config get-value silently succeeding on a missing option
   * #72468 - Fix airflowctl tracebacks on an unusable credentials file
   * #72600 - Make suppress_logs_and_warning CLI decorator return the wrapped result
   * #72656 - Fix dateless dag.test and tasks test destroying unrelated Dag runs
   * #72675 - Fix airflowctl commands crashing instead of printing their result
   * #72893 - Show a clean error when airflow backfill create targets an unknown Dag
   * #72941 - Fix tasks clear --task-regex matching as a plain substring
   * #73033 - Speed up airflow dags list on deployments with many Dags
   * #73070 - Fix airflow dags next-execution crashing on --field data_interval.start
   * #73083 - Fix airflow connections import corrupting JSON values in .env files
   * #73112 - Fix structlog log assertions never matching a single-field dict
   * #73120 - Fix misleading type errors from expand_kwargs and default_args
   * #73121 - Fix bare traceback from kubernetes cleanup-pods without kube config
   * #73132 - Fix airflowctl pools export/import dropping pool team ownership
   * #73157 - Mask extra and credentials in connections list --hide-sensitive
   * #73228 - Fix missing task alert emails on Dags using native template rendering
   * #73348 - Stop providers lazy-loaded from writing the default config
   * #73371 - Fix api-server --apps silently dropping apps and accepting typos
   * #73373 - Fix Task SDK dry-run mode crashing on task instance start
   * #73377 - Fix CLI --bundle-name finding no Dags in Git bundles
   * #73379 - Fix empty audit log dag_id for DAG.cli() subcommands
   * #73387 - Drop ignored --bundle-name and --dagfile-path from DAG.cli()
   * #73400 - Fix indexing mapped task results with a NumPy integer
   * #73409 - Respect maximum_page_limit in batch list endpoints
   * #73422 - Stop the JWT revocation check stalling the API server event loop
   * #73424 - Fix task instance 404 detail being a JSON array instead of a string
   * #73463 - API: Remove unreachable Accept branch and last deprecated 422 alias
   * #73465 - API: Cap run_ids on the grid TI summaries stream endpoint
   * #73472 - Rate-limit JWKS fetch attempts while the endpoint is down
   * #73514 - UI: Fix grid columns vanishing when a Dag version has been cleaned
   
   These pull requests stay open because maintainers are already engaged in them - they count towards your limit:
   
   * #73141 - Fix scheduler refusing to start when [scheduler] only_idle is enabled
   * #73154 - Batch Team lookups when syncing Dag bundles to the database
   
   This is **not** a judgement of you or of your changes. We never told contributors before that opening many pull requests at once was a problem, so there is nothing to feel bad about - and nothing is lost: your branches, commits and the review history stay where they are.
   
   What we ask you to do is to make your **first prioritization decision**: choose which of the pull requests above matter most to you, and reopen them (up to 5 open at a time, including the ones still open) with the "Reopen pull request" button or `gh pr reopen <PR_NUMBER> --repo apache/airflow`. Reopen the ones you are ready to follow through - keep them rebased, respond to review comments and fix failing checks.
   
   While your pull requests are waiting for review, the most valuable thing you can do is help in other ways - reviewing other contributors' pull requests, helping with issues, and taking part in the discussions on the devlist and Slack.
   
   Why we introduced the limit, what it means for you and how to reopen or restore a pull request is explained in https://github.com/apache/airflow/blob/main/contributing-docs/32_open_pull_request_limit.rst.
   
   ---
   Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix airflowctl commands crashing instead of printing their result [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk closed pull request #72675: Fix airflowctl commands crashing instead of printing their result
URL: https://github.com/apache/airflow/pull/72675


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix airflowctl commands crashing instead of printing their result [airflow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #72675:
URL: https://github.com/apache/airflow/pull/72675#issuecomment-5918647154

   ### Backport failed to create: airflow-ctl/v0-1-test. View the failure log <a href='https://github.com/apache/airflow/actions/runs/36769258082'> Run details </a>
   
   Note: As of [Merging PRs targeted for Airflow 3.X](https://github.com/apache/airflow/blob/main/dev/README_AIRFLOW3_DEV.md#merging-prs-targeted-for-airflow-3x)
   the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.
   
   In matter of doubt please ask in [#release-management](https://apache-airflow.slack.com/archives/C03G9H97MM2) Slack channel.
   
   <table>
       <tr>
           <th>Status</th>
           <th>Branch</th>
           <th>Result</th>
       </tr>
       <tr>
           <td>❌</td>
           <td>airflow-ctl/v0-1-test</td>
           <td><a href="https://github.com/apache/airflow/commit/f31b572df18639acf75781aeae8628732e6e2eab"><img src='https://img.shields.io/badge/Commit-f31b572-red' alt='Commit Link'></a></td>
       </tr>
   </table>
   
   You can attempt to backport this manually by running:
   
   ```bash
   cherry_picker f31b572 airflow-ctl/v0-1-test
   ```
   
   This should apply the commit to the airflow-ctl/v0-1-test branch and leave the commit in conflict state marking
   the files that need manual conflict resolution.
   
   After you have resolved the conflicts, you can continue the backport process by running:
   
   ```bash
   cherry_picker --continue
   ```
   
   If you don't have cherry-picker installed, see the [installation guide](https://github.com/apache/airflow/blob/main/dev/README.md#how-to-backport-pr-with-cherry-picker-cli).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix airflowctl commands crashing instead of printing their result [airflow]

Posted by "henry3260 (via GitHub)" <gi...@apache.org>.
henry3260 merged PR #72675:
URL: https://github.com/apache/airflow/pull/72675


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org