Repository navigation
Report missing and invalid fields in airflowctl connections import - #76090
Merged
shahar1 merged 1 commit intoOct 31, 2026
Merged
Conversation
shahar1
requested review from
bugraoz93,
dheerajturaga,
henry3260 and
potiuk
as code owners
October 30, 2026 21:16
Contributor
Author
|
Current CI failure is unrelated, fixed by: #76092 |
shahar1
force-pushed
the
airflowctl-connections-import-missing-fields
branch
from
October 31, 2026 07:19
712757e to
fad1246
Compare
henry3260
approved these changes
Oct 31, 2026
shahar1
force-pushed
the
airflowctl-connections-import-missing-fields
branch
from
October 31, 2026 08:18
fad1246 to
a9267f2
Compare
shahar1
enabled auto-merge (squash)
October 31, 2026 08:18
1 task done
A connection entry without conn_type, or with a bad value such as a non-numeric port, made the import fail with a raw pydantic dump. The dump did not say which connection in the file was broken, and a missing conn_type showed up as "Input should be a valid string", not as a missing field. Generated commands got readable messages in apache#75177; the hand-built import path did not.
shahar1
force-pushed
the
airflowctl-connections-import-missing-fields
branch
from
October 31, 2026 13:14
a9267f2 to
41c22e3
Compare
Contributor
Backport successfully created: airflow-ctl/v0-1-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
shahar1
added a commit
that referenced
this pull request
Oct 31, 2026
…tl connections import (#76090) (#76141) A connection entry without conn_type, or with a bad value such as a non-numeric port, made the import fail with a raw pydantic dump. The dump did not say which connection in the file was broken, and a missing conn_type showed up as "Input should be a valid string", not as a missing field. Generated commands got readable messages in #75177; the hand-built import path did not. (cherry picked from commit 2e8f6f9) Co-authored-by: Shahar Epstein <[email protected]>
shahar1
added a commit
that referenced
this pull request
Nov 19, 2026
…tl connections import (#76090) (#76141) A connection entry without conn_type, or with a bad value such as a non-numeric port, made the import fail with a raw pydantic dump. The dump did not say which connection in the file was broken, and a missing conn_type showed up as "Input should be a valid string", not as a missing field. Generated commands got readable messages in #75177; the hand-built import path did not. (cherry picked from commit 2e8f6f9) Co-authored-by: Shahar Epstein <[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.
This PR moves the missing-vs-invalid field check into shared validation so imports report the connection name and readable error before making an API call.
AI Summary
airflowctl connections importbuildsConnectionBodyby hand, so it missed the readable errors #75177 added for generated commands. An entry withoutconn_type, or with a bad value, still failed with a raw pydantic dump that did not name the broken connection, and a missingconn_typewas reported as a wrong type:Now the import stops before any API call with:
The missing-vs-invalid split from
CommandFactory._validate_datamodelmoves toairflowctl/ctl/utils/validation.pyso both paths share it; the messages of generated commands are unchanged. Valid files and API-side failures behave as before. If a file has several broken entries, only the first one is reported, the same as the existing structure checks.related: #57721
Testing
pytest airflow-ctl/tests/airflow_ctl/ctl/commands/test_connections_command.py airflow-ctl/tests/airflow_ctl/ctl/test_cli_config.py: 169 passed, 1 failed. The new tests fail without the change. The failure,test_create_command_without_required_option_exits_with_friendly_message, also fails on currentmain: Fix airflowctl operations create command validation error #69317 made required body fields argparse-required shortly before Report missing required airflowctl options as readable errors #75177 merged, so argparse rejects the command before Report missing required airflowctl options as readable errors #75177's check runs. This PR does not touch it.prek run mypy-airflow-ctl --all-filespassed. Thepre-commitstage hooks passed on the changed files, exceptgenerate-airflowctl-help-images, which could not build its Docker image locally. No CLI arguments or help text change.manualstage hooks, the full airflow-ctl suite.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 5.5, Sonnet 5.5) following the guidelines
🤖 Generated with Claude Code