You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ibobgunardi (via GitHub)" <gi...@apache.org> on 2026/06/04 10:32:27 UTC

[PR] Make required airflowctl body fields positional [airflow]

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

   Related to #60142.
   
   Required scalar fields from generated request-body models are now emitted as positional arguments. That makes commands like `airflow connections create test_conn postgres` line up with the existing positional handling for required operation parameters, while nullable/defaulted fields stay as options.
   
   Tested with:
   - `PYTHONPATH='airflow-ctl\\src;airflow-core\\src' .venv\\Scripts\\python.exe -m pytest airflow-ctl\\tests\\airflow_ctl\\ctl\\test_cli_config.py -q --confcutdir=airflow-ctl\\tests\\airflow_ctl\\ctl`
   - `.venv\\Scripts\\python.exe -m py_compile airflow-ctl\\src\\airflowctl\\ctl\\cli_config.py airflow-ctl\\tests\\airflow_ctl\\ctl\\test_cli_config.py`
   - `git diff --check`
   
   ##### Was generative AI tooling used to co-author this PR?
   Yes. I used Codex to help inspect the command factory and run the local checks.


-- 
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] Make required airflowctl body fields positional [airflow]

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

   Thanks for the concrete notes. I pushed the follow-ups:
   
   - #68014 now updates the airflowctl e2e connection create/update commands to the positional form and the PR body calls out the breaking CLI change.
   - #67912 now preserves literal operation defaults when generating optional primitive CLI flags, so omitting `--limit` uses the operation default instead of passing `None`; the e2e command now omits `--limit`.
   - #68000 is closed in favor of #68014 to avoid the conflicting required-flag design.
   
   Local checks:
   - `python -m py_compile airflow-ctl\src\airflowctl\ctl\cli_config.py airflow-ctl\tests\airflow_ctl\ctl\test_cli_config.py airflow-ctl-tests\tests\airflowctl_tests\test_airflowctl_commands.py`
   - `PYTHONPATH='airflow-ctl\src;airflow-core\src' .\.venv\Scripts\python.exe -m pytest airflow-ctl\tests\airflow_ctl\ctl\test_cli_config.py airflow-ctl\tests\airflow_ctl\api\test_operations.py::TestTasksOperations -q --confcutdir=airflow-ctl\tests\airflow_ctl\ctl`


-- 
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] Make required airflowctl body fields positional [airflow]

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

   @ibobgunardi — the **Static checks** job (plus some failing tests) is failing here — the static checks need a code fix on your side, and the test failures are worth a look too. You can reproduce and fix locally with:
   
   ```
   pre-commit run --all-files     # or: breeze static-checks
   ```
   
   Once those pass and CI is green, it'll be ready for a maintainer to pick up. Thanks!
   
   See the [PR quality criteria](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-quality-criteria).
   
   <sub>Automated first-pass triage note drafted by an AI-assisted tool — may get things wrong; once addressed, a real Apache Airflow maintainer takes the next look. ([why automated](https://github.com/apache/airflow/blob/main/contributing-docs/25_maintainer_pr_triage.md))</sub>
   
   ---
   Drafted-by: Claude Code (Opus 4.8); 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] Make required airflowctl body fields positional [airflow]

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

   Thanks for the airflowctl improvements, @ibobgunardi — picking these up together since the three PRs (this, #68000, #67912) overlap and there are a couple of concrete fixes needed before they land.
   
   **#68000 vs this PR — conflict.** These two edit the same two call sites in `cli_config.py` with opposite designs: #68000 makes required body fields `required=True` flags, while this one makes them **positional**. They're mutually exclusive and will textually conflict. The positional approach here is the right one — it matches the dev-list lazy consensus this file already follows for required primitive params. Could you fold #68000 into this PR (or close it) so we're not reviewing two contradictory designs for the same fields?
   
   **This PR — e2e test will break.** Once required scalar body fields become positional, the existing invocations in `airflow-ctl-tests/tests/airflowctl_tests/test_airflowctl_commands.py:66,72` still use the flag form and will fail with "unrecognized arguments":
   
   - `connections create --connection-id=test_con --conn-type=mysql …` → `connections create test_con mysql …`
   - `connections update --connection-id=test_con --conn-type=postgres` → `connections update test_con postgres`
   
   Worth a line in the PR body noting this is a breaking CLI change, so the release manager captures it under "Significant Changes".
   
   **#67912 — crash when `--limit` is omitted.** `airflowctl tasks states-for-dag-run <dag> <run>` without `--limit` passes `limit=None` into `execute_list` → `if limit <= 0:` → `TypeError: '<=' not supported between 'NoneType' and 'int'`. It's the first `execute_list` caller to expose `limit` to the CLI. Please default the flag (or coerce `None`→default before `super().execute_list`) and add a test that omits `--limit`.
   
   None of these are big — mostly coordination plus two small fixes. Happy to take another look once they're reconciled.
   
   ---
   Drafted-by: Claude Code (Opus 4.8); 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] Make required airflowctl body fields positional [airflow]

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

   @ibobgunardi This PR has a few issues that need to be addressed before it can be reviewed — please see our [Pull Request quality criteria](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-quality-criteria).
   
   **Issues found:**
   - :x: **Unit tests**: Failing: `Additional PROD image tests / Airflow CTL integration tests with PROD image`. Run `breeze run pytest <path> -xvs` locally.
   - :x: **Pre-commit / static checks**: Failing: `CI image checks / Static checks`. Run `prek run --from-ref main --stage pre-commit` locally to reproduce and fix.
   
   > **Note:** Your branch is **1053 commits behind `main`**. Some check failures may be caused by changes in the base branch rather than by your PR. Please rebase your branch and push again to get up-to-date CI results.
   
   **What to do next:**
   - Fix each issue listed above.
   - Make sure static checks pass locally (`prek run --from-ref main --stage pre-commit`).
   - Mark the PR as "Ready for review" when you're done.
   
   There is no rush — take your time and work at your own pace. We appreciate your contribution and are happy to wait for updates. If you have questions, feel free to ask on the [Airflow Slack](https://s.apache.org/airflow-slack).
   
   ---
   
   _Note: This comment was drafted by an AI-assisted triage tool and may contain mistakes. Once you have addressed the points above, an Apache Airflow maintainer — a real person — will take the next look at your PR. We use this [two-stage triage process](https://github.com/apache/airflow/blob/main/contributing-docs/25_maintainer_pr_triage.md#why-the-first-pass-is-automated) so that our maintainers' limited time is spent where it matters most: the conversation with you._


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