josh-fell opened a new pull request, #23241: URL: https://github.com/apache/airflow/pull/23241
Related: #22607 There are a few connections which have default values for particular extra fields namely Google (`extra__google_cloud_platform__num_retries`: 5), Kubernetes (`extra__kubernetes__in_cluster`: False), and Snowflake (`extra__snowflake__insecure_mode`: False). Since all extra fields are available in the form data, a check is needed to only add extra fields that are germane to the connection type of the submission. Otherwise, the extras with default values could be added to a connection's URI and `extra_dejson` incorrectly. For example, before this change, assuming a user submits a connection like so: <img width="799" alt="image" src="https://user-images.githubusercontent.com/48934154/165216271-933e0293-1d7a-4086-b448-d416c5fcbcf8.png"> The connection data stores extra information for `extra__google_cloud_platform__num_retries`: <img width="1408" alt="image" src="https://user-images.githubusercontent.com/48934154/165216385-c98140ce-047a-4605-9c51-5f009e4497d6.png"> With this change, the connection data does not contain extras which are not of the same connection type as the form submission: <img width="1171" alt="image" src="https://user-images.githubusercontent.com/48934154/165216516-1ad564f2-3cce-4b50-be68-2e7238e6d2c7.png"> --- **^ Add meaningful description above** Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#pull-request-guidelines)** for more information. In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed. In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x). In case of backwards incompatible changes please leave a note in a newsfragement file, named `{pr_number}.significant.rst`, in [newsfragments](https://github.com/apache/airflow/tree/main/newsfragments). -- 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]
