This is an automated email from the ASF dual-hosted git repository.
bbovenzi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new b5974c64d43 fix edit connection (#49989)
b5974c64d43 is described below
commit b5974c64d43dfb8837c3d1efb885b5f88f131d9a
Author: Shubham Raj <[email protected]>
AuthorDate: Wed Apr 30 20:19:14 2025 +0530
fix edit connection (#49989)
---
.../src/airflow/ui/src/pages/Connections/EditConnectionButton.tsx | 2 +-
airflow-core/src/airflow/ui/src/queries/useEditConnection.tsx | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git
a/airflow-core/src/airflow/ui/src/pages/Connections/EditConnectionButton.tsx
b/airflow-core/src/airflow/ui/src/pages/Connections/EditConnectionButton.tsx
index 07b0f5a98d5..33ce9832b9a 100644
--- a/airflow-core/src/airflow/ui/src/pages/Connections/EditConnectionButton.tsx
+++ b/airflow-core/src/airflow/ui/src/pages/Connections/EditConnectionButton.tsx
@@ -38,7 +38,7 @@ const EditConnectionButton = ({ connection, disabled }:
Props) => {
conn_type: connection.conn_type,
connection_id: connection.connection_id,
description: connection.description ?? "",
- extra: connection.extra ?? "{}",
+ extra: connection.extra === "" || connection.extra === null ? "{}" :
connection.extra,
host: connection.host ?? "",
login: connection.login ?? "",
password: connection.password ?? "",
diff --git a/airflow-core/src/airflow/ui/src/queries/useEditConnection.tsx
b/airflow-core/src/airflow/ui/src/queries/useEditConnection.tsx
index 86225053a60..6f7face3a32 100644
--- a/airflow-core/src/airflow/ui/src/queries/useEditConnection.tsx
+++ b/airflow-core/src/airflow/ui/src/queries/useEditConnection.tsx
@@ -91,6 +91,7 @@ export const useEditConnection = (
...requestBody,
conn_type: requestBody.conn_type,
connection_id: initialConnection.connection_id,
+ extra: requestBody.extra === "{}" ? undefined : requestBody.extra,
// eslint-disable-next-line unicorn/no-null
port: requestBody.port === "" ? null : Number(requestBody.port),
},