This is an automated email from the ASF dual-hosted git repository.
ash pushed a commit to branch v3-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v3-1-test by this push:
new 24d1594faa4 [v3-1-test] Fix connection retrieval from secrets backend
without conn_type (#58528) (#58664)
24d1594faa4 is described below
commit 24d1594faa4a6769f32cad57fafe72a2deb3b520
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Nov 25 08:17:25 2025 +0000
[v3-1-test] Fix connection retrieval from secrets backend without conn_type
(#58528) (#58664)
---
task-sdk/src/airflow/sdk/definitions/connection.py | 6 ------
task-sdk/tests/task_sdk/definitions/test_connection.py | 17 -----------------
2 files changed, 23 deletions(-)
diff --git a/task-sdk/src/airflow/sdk/definitions/connection.py
b/task-sdk/src/airflow/sdk/definitions/connection.py
index 27888f5bf08..89727b11c12 100644
--- a/task-sdk/src/airflow/sdk/definitions/connection.py
+++ b/task-sdk/src/airflow/sdk/definitions/connection.py
@@ -293,12 +293,6 @@ class Connection:
@classmethod
def from_json(cls, value, conn_id=None) -> Connection:
kwargs = json.loads(value)
- conn_type = kwargs.get("conn_type", None)
- if not conn_type:
- raise ValueError(
- "Connection type (conn_type) is required but missing from
connection configuration. "
- "Please add 'conn_type' field to your connection definition."
- )
extra = kwargs.pop("extra", None)
if extra:
kwargs["extra"] = extra if isinstance(extra, str) else
json.dumps(extra)
diff --git a/task-sdk/tests/task_sdk/definitions/test_connection.py
b/task-sdk/tests/task_sdk/definitions/test_connection.py
index 73bc938abc1..25fab314e2a 100644
--- a/task-sdk/tests/task_sdk/definitions/test_connection.py
+++ b/task-sdk/tests/task_sdk/definitions/test_connection.py
@@ -190,23 +190,6 @@ class TestConnections:
assert connection.host == "localhost"
assert connection.port == 5432
- def test_from_json_missing_conn_type(self):
- """Test that missing conn_type throws an error while using
from_json."""
- import re
-
- json_data = {
- "host": "localhost",
- "port": "5432",
- }
-
- with pytest.raises(
- ValueError,
- match=re.escape(
- "Connection type (conn_type) is required but missing from
connection configuration. Please add 'conn_type' field to your connection
definition."
- ),
- ):
- Connection.from_json(json.dumps(json_data), conn_id="test_conn")
-
def test_extra_dejson_property(self):
"""Test that extra_dejson property correctly deserializes JSON extra
field."""
connection = Connection(