This is an automated email from the ASF dual-hosted git repository.

eladkal 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 a856ed4fb0 extra being passed to SQLalchemy (#40391)
a856ed4fb0 is described below

commit a856ed4fb04352798664e79b9ff32b9f375b1d75
Author: Aritra Basu <[email protected]>
AuthorDate: Thu Jun 27 09:13:42 2024 +0530

    extra being passed to SQLalchemy (#40391)
    
    The edit prefills an empty extra field (None)
    with a empty dictionary, which is decoded
    to an extra field being passed in the con url.
---
 airflow/www/views.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/airflow/www/views.py b/airflow/www/views.py
index 8311050bff..5559ea45d8 100644
--- a/airflow/www/views.py
+++ b/airflow/www/views.py
@@ -4408,7 +4408,10 @@ class ConnectionModelView(AirflowModelView):
             if is_sensitive and field_name in extra_dictionary:
                 extra_dictionary[field_name] = SENSITIVE_FIELD_PLACEHOLDER
         # form.data is a property that builds the dictionary from fields so we 
have to modify the fields
-        form.extra.data = json.dumps(extra_dictionary)
+        if extra_dictionary:
+            form.extra.data = json.dumps(extra_dictionary)
+        else:
+            form.extra.data = None
 
 
 class PluginView(AirflowBaseView):

Reply via email to