-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
Automatically create section when migrating config #16814
Conversation
It should not error, as we have deprecations for the configs/sections that are moved: airflow/airflow/configuration.py Lines 105 to 185 in b251d22
|
And for the all configs that don't exist in user's airflow.cfg we default to Airflow's default config (which is separate than user's airflow.cfg) airflow/airflow/configuration.py Line 359 in b251d22
|
@kaxil Ohh, I see. So the section exists in the default_config, but when we to the upgrade and try to write the config back , the sections are only checked in the top level config, cos that's where we are writing to. |
@uranusjr We should probably expand the unit tests to cover this case |
@uranusjr Ping - I think this is worth finishing off. |
Trying to figure out what needs to be done here. So the patch is not wrong (although my description to the issue was, and a unit test should be added to cover the section-only-in-default-config-not-user-config case. Is that right? |
Yup, that's right. |
The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease. |
9be73f0
to
c274c00
Compare
Previously, if a config is migrated to a new section, the migration code would crash with NoSectionError if the user does not add that section to airflow.cfg after upgrading Airflow. This patch automatically creates an empty section when that happens to avoid Airflow from crashing.
c274c00
to
aa02043
Compare
Previously, if a config is migrated to a new section, the migration code would crash with NoSectionError if the user does not add that section to airflow.cfg after upgrading Airflow. This patch automatically creates an empty section when that happens to avoid Airflow from crashing.