You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "josh-fell (via GitHub)" <gi...@apache.org> on 2024/11/09 03:26:47 UTC

Re: [PR] Fix problem with inability to remove fields from Connection form [airflow]

josh-fell commented on code in PR #40421:
URL: https://github.com/apache/airflow/pull/40421#discussion_r1835235437


##########
airflow/www/views.py:
##########
@@ -4359,10 +4359,7 @@ def process_form(self, form, is_created):
                 conn_type_from_extra_field = key.split("__")[1]
                 if conn_type_from_extra_field == conn_type:
                     value = form.data[key]
-                    # Some extra fields have a default value of False so we need to explicitly check the
-                    # value isn't an empty string.
-                    if value != "":
-                        extra[field_name] = value
+                    extra[field_name] = value

Review Comment:
   Oddly enough @dstandish [asked the same question](https://github.com/apache/airflow/pull/23241#issuecomment-1109814135) in the original PR. Effectively what was happening is non-string fields like those which were declared as `BooleanField` _or_ `IntegerField`s were being applied behind the scenes. Therefore, generating a connection URI was incorrect and included an attribute that was completely unrelated to another connection in the majority of cases.



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org