-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Abhishek Ray
committed
Jan 2, 2020
1 parent
9335fa1
commit 38559b6
Showing
6 changed files
with
29 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
include README.md | ||
include MANIFEST.in | ||
include setup.cfg | ||
include setup.py | ||
recursive-include airflow_prometheus_exporter/ * | ||
|
||
recursive-exclude * __pycache__ | ||
recursive-exclude * *.py[co] | ||
recursive-exclude * .*.sw[a-z] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
import yaml | ||
import os | ||
from pathlib import Path | ||
|
||
dir = os.path.dirname(__file__) | ||
filename = os.path.join(dir, "../config.yaml") | ||
CONFIG_FILE = Path.cwd() / "config.yaml" | ||
|
||
|
||
xcom_config = {} | ||
with open(filename) as file: | ||
# The FullLoader parameter handles the conversion from YAML | ||
# scalar values to Python the dictionary format | ||
xcom_config = yaml.load(file, Loader=yaml.FullLoader) | ||
def load_xcom_config(): | ||
"""Loads the XCom config if present.""" | ||
try: | ||
with open(CONFIG_FILE) as file: | ||
# The FullLoader parameter handles the conversion from YAML | ||
# scalar values to Python the dictionary format | ||
return yaml.load(file, Loader=yaml.FullLoader) | ||
except FileNotFoundError: | ||
return {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters