From 11dfd15def62d694577d9f46edb8a4e9131e004c Mon Sep 17 00:00:00 2001 From: HaoWuPeloton <51166891+HaoWuPeloton@users.noreply.github.com> Date: Sun, 3 Dec 2023 20:23:50 -0500 Subject: [PATCH] support airflow dag restructure --- dagfactory/dagfactory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dagfactory/dagfactory.py b/dagfactory/dagfactory.py index 562f3c38..277ae2b0 100644 --- a/dagfactory/dagfactory.py +++ b/dagfactory/dagfactory.py @@ -109,7 +109,7 @@ def from_directory(cls, config_dir, globals: Dict[str, Any], parent_default_conf if os.path.isdir(sub_fpath): 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 'git/repo/dags/data_engineering' in sub_fpath: + if 'git/repo/dags/data_engineering' in sub_fpath and CONFIG_FILENAME_REGEX.match(sub_fpath.split("/")[-1]): print("sub_fpath="+sub_fpath) default_config['default_args']['owner'] = sub_fpath.split("/")[4] default_config['tags'] = sub_fpath.split("/")[5:7]