Skip to content

Commit b4c64a1

Browse files
committed
feat: add merge tables optional param
1 parent e790e66 commit b4c64a1

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

materializationengine/celery_worker.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,18 @@ def setup_periodic_tasks(sender, **kwargs):
112112
run_periodic_materialization,
113113
)
114114

115+
merge_tables = get_config_param("MERGE_TABLES")
115116
periodic_tasks = {
116117
"run_daily_periodic_materialization": run_periodic_materialization.s(
117-
days_to_expire=2
118+
days_to_expire=2, merge_tables=merge_tables
118119
),
119120
"run_weekly_periodic_materialization": run_periodic_materialization.s(
120-
days_to_expire=7
121+
days_to_expire=7, merge_tables=merge_tables
121122
),
122123
"run_lts_periodic_materialization": run_periodic_materialization.s(
123-
days_to_expire=days_till_next_month(datetime.datetime.utcnow())
124+
days_to_expire=days_till_next_month(
125+
datetime.datetime.utcnow(), merge_tables=merge_tables
126+
)
124127
),
125128
"run_periodic_database_update": run_periodic_database_update.s(),
126129
"remove_expired_databases": remove_expired_databases.s(

materializationengine/config.py

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class BaseConfig:
3939
INFO_API_VERSION = 2
4040
MIN_DATABASES = 2
4141
MAX_DATABASES = 2
42+
MERGE_TABLES = True
4243
AUTH_SERVICE_NAMESPACE = "datastack"
4344
if os.environ.get("DAF_CREDENTIALS", None) is not None:
4445
with open(os.environ.get("DAF_CREDENTIALS"), "r") as f:

0 commit comments

Comments
 (0)