Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix updating variables during variable imports #33932

Merged

Conversation

ephraimbuddy
Copy link
Contributor

We should only create new variables during variable imports and not update already existing variables.

airflow/www/views.py Outdated Show resolved Hide resolved
airflow/www/views.py Outdated Show resolved Hide resolved
airflow/www/views.py Outdated Show resolved Hide resolved
@potiuk
Copy link
Member

potiuk commented Aug 31, 2023

I think we should a flag specifying that behaviour. I think the flag should be something of (probably too long name):

--action-on-existing-key: override (default) skip fail 

IMHO override shoudl remain as it is (default), as it could break existing usages.

@ephraimbuddy ephraimbuddy force-pushed the dont-override-variables-during-import branch from 2738fc5 to 2718f6f Compare August 31, 2023 14:00
@ephraimbuddy
Copy link
Contributor Author

I think we should a flag specifying that behaviour. I think the flag should be something of (probably too long name):

--action-on-existing-key: override (default) skip fail 

IMHO override shoudl remain as it is (default), as it could break existing usages.

Implemented this also in the UI with radios:
Screenshot 2023-08-31 at 15 13 10

I can't think of a better name than the one you suggested.

@ephraimbuddy ephraimbuddy force-pushed the dont-override-variables-during-import branch from 2718f6f to 7c6080b Compare August 31, 2023 14:14
@ephraimbuddy ephraimbuddy force-pushed the dont-override-variables-during-import branch from 7c6080b to 161e822 Compare September 1, 2023 08:59
ephraimbuddy and others added 6 commits September 1, 2023 13:02
We should only create new variables during variable imports and not update
already existing variables.
Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
@ephraimbuddy ephraimbuddy force-pushed the dont-override-variables-during-import branch from 3e29b65 to 91fd57d Compare September 1, 2023 12:02
@ephraimbuddy ephraimbuddy added this to the Airflow 2.7.1 milestone Sep 1, 2023
@ephraimbuddy ephraimbuddy added the type:bug-fix Changelog: Bug Fixes label Sep 1, 2023
@ephraimbuddy ephraimbuddy merged commit 0e1c106 into apache:main Sep 1, 2023
42 checks passed
@ephraimbuddy ephraimbuddy deleted the dont-override-variables-during-import branch September 1, 2023 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:webserver Webserver related Issues type:bug-fix Changelog: Bug Fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants