@@ -20,25 +20,23 @@ def parse_config_name(config):
2020 return config , "v1"
2121
2222
23- def generate_stable_table_bigconfig_files (target_project , enable_monitoring ):
23+ def generate_stable_table_bigconfig_files (target_project , output_dir , enable_monitoring ):
2424 """Generate the metadata and bigconfig files and write to correct directories."""
25- THIS_PATH = Path (__file__ ).parent
26- TEMPLATES_DIR = THIS_PATH / "templates"
27- SQL_BASE_DIR = THIS_PATH .parent .parent / "sql" / target_project
25+ templates_dir = Path (__file__ ).parent / "templates"
26+ sql_base_dir = Path (output_dir ) / target_project
2827
29- BIGEYE_COLLECTION = "Operational Checks"
30- BIGEYE_SLACK_CHANNEL = "#de-bigeye-triage"
28+ bigeye_collection = "Operational Checks"
29+ bigeye_slack_channel = "#de-bigeye-triage"
3130
32- env = Environment (loader = FileSystemLoader (str (TEMPLATES_DIR )))
31+ env = Environment (loader = FileSystemLoader (str (templates_dir )))
3332 bigconfig_template = env .get_template ("bigconfig.yml.jinja" )
3433 metadata_template = env .get_template ("metadata.yaml.jinja" )
3534
3635 stable_table_bigconfigs = ConfigLoader .get ("monitoring" , "stable_tables_monitoring" )
3736
3837 # Create directory for each dataset
3938 for dataset_name , table_names in stable_table_bigconfigs .items ():
40-
41- target_dir = SQL_BASE_DIR / dataset_name
39+ target_dir = sql_base_dir / dataset_name
4240 target_dir .mkdir (parents = True , exist_ok = True )
4341
4442 # Create directory for each table each with a metadata.yaml and bigconfig.yml file
@@ -50,12 +48,12 @@ def generate_stable_table_bigconfig_files(target_project, enable_monitoring):
5048 dataset = dataset_name ,
5149 name = name_part ,
5250 version = version_part ,
53- bigeye_collection = BIGEYE_COLLECTION ,
54- bigeye_notification_slack_channel = BIGEYE_SLACK_CHANNEL ,
51+ bigeye_collection = bigeye_collection ,
52+ bigeye_notification_slack_channel = bigeye_slack_channel ,
5553 )
5654
5755 metadata_rendered = metadata_template .render (
58- bigeye_collection = BIGEYE_COLLECTION ,
56+ bigeye_collection = bigeye_collection ,
5957 enable_monitoring = enable_monitoring ,
6058 name = name_part ,
6159 )
0 commit comments