You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Leondon9 (via GitHub)" <gi...@apache.org> on 2026/05/17 16:23:36 UTC
[PR] Fix airflow-ctl connections import schema handling [airflow]
Leondon9 opened a new pull request, #67063:
URL: https://github.com/apache/airflow/pull/67063
Fixes `airflow-ctl connections import` so imported connection JSON preserves the public `schema` field and sends connection request bodies using API aliases.
How this is fixed:
- Pass the imported `schema` value into the generated `ConnectionBody` model through its public alias.
- Serialize connection create, update, test, and bulk request bodies with `by_alias=True` so the API receives `schema` rather than the generated internal `schema_` attribute.
- Add request-body regression coverage for create, update, test, bulk, and the CLI import path.
Benefit:
- Users can import connection definitions through `airflow-ctl` without silently losing the schema/database value.
- Automation that seeds or migrates Airflow connections from JSON keeps the same target database or namespace after import.
closes: #67062
Tests:
- `breeze run pytest airflow-ctl/tests/airflow_ctl/api/test_operations.py airflow-ctl/tests/airflow_ctl/ctl/commands/test_connections_command.py -xvs`
- `prek run ruff-format --files airflow-ctl/src/airflowctl/api/operations.py airflow-ctl/src/airflowctl/ctl/commands/connection_command.py airflow-ctl/tests/airflow_ctl/api/test_operations.py airflow-ctl/tests/airflow_ctl/ctl/commands/test_connections_command.py`
- `prek run ruff --files airflow-ctl/src/airflowctl/api/operations.py airflow-ctl/src/airflowctl/ctl/commands/connection_command.py airflow-ctl/tests/airflow_ctl/api/test_operations.py airflow-ctl/tests/airflow_ctl/ctl/commands/test_connections_command.py`
- `git diff --check`
Note: `prek --from-ref upstream/main` could not complete locally because the hook bootstrap selected Python 3.9 for `blacken-docs`, while that hook dependency requires Python >=3.10. The changed-file ruff hooks above passed.
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes — OpenAI Codex GPT-5
Generated-by: OpenAI Codex GPT-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 airflow-ctl connections import schema handling [airflow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #67063:
URL: https://github.com/apache/airflow/pull/67063#issuecomment-4472464655
### Backport successfully created: airflow-ctl/v0-1-test
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/pull/67072"><img src="https://img.shields.io/badge/PR-67072-blue" alt="PR Link"></a></td>
</tr>
</table>
--
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 airflow-ctl connections import schema handling [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk merged PR #67063:
URL: https://github.com/apache/airflow/pull/67063
--
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