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

[AIRFLOW-1457] fix user-defined log import #2648

Closed
wants to merge 1 commit into from
Closed

[AIRFLOW-1457] fix user-defined log import #2648

wants to merge 1 commit into from

Conversation

ahvigil
Copy link

@ahvigil ahvigil commented Sep 29, 2017

We can use json.load to import a user defined json config for passing into logging.config.dictConfig

Dear Airflow maintainers,

Please accept this PR. I understand that it will not be reviewed until I have checked off all the steps below!

JIRA

Description

  • Here are some details about my PR, including screenshots of any UI changes:

user-defined logging configuration provided as part of AIRFLOW-1457 is broken- current code tries to import a string value pulled from the config. This always fails and results in the default config being loaded.

Since contents of logging_config_path will get passed to logging.config.DictConfig as a dictionary, it should be json de/serializable and so we can use json.load to read the file instead.

Tests

  • My PR adds the following unit tests OR does not need testing for this extremely good reason:
    I can add tests at some point if you want, but settings.py currently does not have any unit tests and this is a pretty core functionality that is broken so I really just want to get it working :)

Commits

  • My commits all reference JIRA issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "How to write a good git commit message":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

We can use `json.load` to import a user defined json config for passing into `logging.config.dictConfig`
@criccomini
Copy link
Contributor

The JIRA looks different from the PR

@ahvigil
Copy link
Author

ahvigil commented Sep 29, 2017

argh, i see now this is being addressed now in #2631

@ahvigil ahvigil closed this Sep 29, 2017
@codecov-io
Copy link

codecov-io commented Sep 29, 2017

Codecov Report

Merging #2648 into master will decrease coverage by <.01%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2648      +/-   ##
==========================================
- Coverage   71.75%   71.75%   -0.01%     
==========================================
  Files         152      152              
  Lines       11749    11751       +2     
==========================================
+ Hits         8431     8432       +1     
- Misses       3318     3319       +1
Impacted Files Coverage Δ
airflow/settings.py 88.29% <66.66%> (-0.84%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a1b2c0f...6f1cb8b. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants