-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
[AIRFLOW-833] Add an airflow default_config
sub-command
#2052
Conversation
I suggest that running |
airflow/configuration.py
Outdated
self.read_string(parameterized_config(TEST_CONFIG)) | ||
# then read any "custom" test settings | ||
self.read(TEST_CONFIG_FILE) | ||
def load_or_save_config_file(self, config_file, config_string=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be split into two methods, load_config_file
and save_config_file
. Otherwise it will be extremely confusing to figure out what it's doing when reading code.
I'm not sure I understand what you mean here, can you elaborate? Are you suggesting to bundle the proposed functionality into |
Nope, I like the new command, I am just suggesting that in addition, the initdb function (https://github.com/apache/incubator-airflow/blob/master/airflow/utils/db.py#L102) should automatically run it if it hasn't been run already That way the start becomes: pip install airflow # required
airflow default_config # optional, only for advanced users who know they want to customize settings off the bat
airflow initdb # required, and will generate the default if the previous command wasn't run |
Ah ok, makes sense; will do! |
Please also add unit tests that cover the new functions and updated functions. |
- Generate the default airflow.cfg explicitly with a command, not when simply importing airflow. - The default airflow.cfg is also created on `airflow initdb` if it doesn't exist already. - Don't create the unittests.cfg unless unit_test_mode is true.
fc02366
to
7de2eff
Compare
Codecov Report
@@ Coverage Diff @@
## master #2052 +/- ##
==========================================
+ Coverage 67.7% 67.71% +0.01%
==========================================
Files 139 139
Lines 10579 10593 +14
==========================================
+ Hits 7162 7173 +11
- Misses 3417 3420 +3
Continue to review full report at Codecov.
|
All comments addressed in the new PR |
for consistency with the rest of the commands can we name it like a verb (eg |
I'm afraid I don't have the time and inclination to jump through any more hoops by an unspecified set of reviewers (presumably core contributors though I can't tell). The way this ticket and especially #2078 have been handled so far don't make me feel that "contributions are welcome and are greatly appreciated" as advertised. Feel free to make any remaining changes you deem necessary for this PR and merge it, or not. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Bump |
Dear Airflow Maintainers,
Please accept this PR that addresses the following issues: