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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
