dstandish opened a new pull request #22607:
URL: https://github.com/apache/airflow/pull/22607


   Historically when adding custom extra fields we had to store them in the 
`extra` json field as `extra__conn_type__field_name`.
   
   This was somewhat cumbersome.  And it meant that when adding them as UI form 
fields, you had to make a change to the structure of the `extra` schema.
   
   With this PR, we do away with the requirement of this prefix.  In effect, we 
separate the field "key" -- how it is identified internally in the model and 
form -- with "name", how it is identified in the `extra` json field.
   
   This leaves us with a backward compatible change, so that we can update hook 
classes (or class families) one at a time.
   
   When the hook's field identifiers are updated to remove the prefix, old 
`extra` field data will still be prefilled when editing a conn in the UI.  
   
   One wrinkle was, when saving a connection that was created with the old 
schema, we have a choice whether to _add_ the new key (e.g. `my_param`) 
alongside the old key (`extra__conn_type__my_param`), or whether to replace it 
(delete `extra__conn_type__my_param`).  I elected to go the non-destructive 
route -- keeping the old value there.  Seems the lesser of two evils.
   


-- 
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]


Reply via email to