Skip to content

Commit

Permalink
support airflow dag restructure
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoWuPeloton committed Nov 13, 2023
1 parent 0ea4616 commit 7516888
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dagfactory/__version__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""Module contains the version of dag-factory"""
__version__ = "0.17.1.post8.dev0"
__version__ = "0.17.1.post8.dev2"
5 changes: 3 additions & 2 deletions dagfactory/dagfactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,9 @@ def from_directory(cls, config_dir, globals: Dict[str, Any], parent_default_conf
cls.from_directory(sub_fpath, globals, default_config)
elif os.path.isfile(sub_fpath) and sub_fpath.split('.')[-1] in ALLOWED_CONFIG_FILE_SUFFIX:
if 'owner' not in default_config['default_args']:
default_config['default_args']['owner'] = sub_fpath.split("/")[4]
default_config['tags'] = sub_fpath.split("/")[5:7]
if 'git/repo' in sub_fpath:
default_config['default_args']['owner'] = sub_fpath.split("/")[4]
default_config['tags'] = sub_fpath.split("/")[5:7]
# catch the errors so the rest of the dags can still be imported
try:
dag_factory = cls(config_filepath=sub_fpath, default_config=default_config)
Expand Down

0 comments on commit 7516888

Please sign in to comment.