Skip to content

Fix serializer for empty string extra connection#65014

Merged
pierrejeambrun merged 2 commits into
apache:mainfrom
astronomer:fix/connection-empty-extra-64950
Apr 14, 2026
Merged

Fix serializer for empty string extra connection#65014
pierrejeambrun merged 2 commits into
apache:mainfrom
astronomer:fix/connection-empty-extra-64950

Conversation

@pierrejeambrun

@pierrejeambrun pierrejeambrun commented Apr 10, 2026

Copy link
Copy Markdown
Member

closes: #64950

For backward compatibility reasons (since AF2 I believe, empty string "" is still supported as a valid value for extra field in connection)


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: [Claude] following the guidelines


  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes FastAPI response serialization for Connections whose extra value is persisted as an empty string (""), preserving backward compatibility and preventing a 500 error in the connections endpoint (regression for #64950).

Changes:

  • Adjust ConnectionResponse.redact_extra to treat "" as a valid no-op value (skip JSON parsing/redaction).
  • Add a regression test covering extra being NULL or "" on the GET connection endpoint.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
airflow-core/src/airflow/api_fastapi/core_api/datamodels/connections.py Prevents JSON parsing/serialization errors by accepting empty-string extra in the response validator.
airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_connections.py Adds coverage ensuring GET /connections/{id} returns 200 when extra is NULL or "".

Comment thread airflow-core/src/airflow/api_fastapi/core_api/datamodels/connections.py Outdated
…ctions.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@pierrejeambrun pierrejeambrun merged commit 41bd4cd into apache:main Apr 14, 2026
142 checks passed
@pierrejeambrun pierrejeambrun deleted the fix/connection-empty-extra-64950 branch April 14, 2026 12:58
github-actions Bot pushed a commit that referenced this pull request Apr 14, 2026
* Fix serializer for empty string extra connection

* Update airflow-core/src/airflow/api_fastapi/core_api/datamodels/connections.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------
(cherry picked from commit 41bd4cd)

Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-2-test

Note: As of Merging PRs targeted for Airflow 3.X
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 Slack channel.

Status Branch Result
v3-2-test PR Link

pierrejeambrun added a commit that referenced this pull request Apr 14, 2026
…#65215)

* Fix serializer for empty string extra connection

* Update airflow-core/src/airflow/api_fastapi/core_api/datamodels/connections.py



---------
(cherry picked from commit 41bd4cd)

Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
vatsrahul1001 pushed a commit that referenced this pull request Apr 15, 2026
…#65215)

* Fix serializer for empty string extra connection

* Update airflow-core/src/airflow/api_fastapi/core_api/datamodels/connections.py



---------
(cherry picked from commit 41bd4cd)

Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
vatsrahul1001 pushed a commit that referenced this pull request Apr 15, 2026
…#65215)

* Fix serializer for empty string extra connection

* Update airflow-core/src/airflow/api_fastapi/core_api/datamodels/connections.py



---------
(cherry picked from commit 41bd4cd)

Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
vatsrahul1001 pushed a commit that referenced this pull request Apr 15, 2026
…#65215)

* Fix serializer for empty string extra connection

* Update airflow-core/src/airflow/api_fastapi/core_api/datamodels/connections.py



---------
(cherry picked from commit 41bd4cd)

Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
vatsrahul1001 pushed a commit that referenced this pull request Apr 15, 2026
…#65215)

* Fix serializer for empty string extra connection

* Update airflow-core/src/airflow/api_fastapi/core_api/datamodels/connections.py



---------
(cherry picked from commit 41bd4cd)

Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Connections panel inacessible after 3.2 migration

4 participants