josh-fell commented on code in PR #40421:
URL: https://github.com/apache/airflow/pull/40421#discussion_r1835237113
##########
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:
Small edit: ...which were declared as `BooleanField` or `IntegerField`s
_with a default value_ were being applied. The default value is key here. This
is what the intention of the PR was attempting to prevent.
> >
>
> @potiuk hello, maybe we can change code something like this:
>
> if value != "":
> extra[field_name] = value
> elif field_name in extra:
> del extra[field_name]
>
> in this case we still save previous behavior and, also, we can delete
value if the user decide delete it on UI.
>
@MaksYermak this alternative you proposed seems reasonable to me!
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]