|
@@ -279,8 +279,9 @@ def sync_partition(partition_dt: str) -> int:
|
|
|
merged_rows: dict[str, dict[str, object]] = {}
|
|
merged_rows: dict[str, dict[str, object]] = {}
|
|
|
for row in _fetch_partition_rows_from_primary_source(partition_dt):
|
|
for row in _fetch_partition_rows_from_primary_source(partition_dt):
|
|
|
merged_rows[str(row["demand_id"])] = row
|
|
merged_rows[str(row["demand_id"])] = row
|
|
|
- for row in _fetch_partition_rows_from_secondary_source(partition_dt):
|
|
|
|
|
- merged_rows[str(row["demand_id"])] = row
|
|
|
|
|
|
|
+ if settings.demand_pool_secondary_sync_enabled:
|
|
|
|
|
+ for row in _fetch_partition_rows_from_secondary_source(partition_dt):
|
|
|
|
|
+ merged_rows[str(row["demand_id"])] = row
|
|
|
|
|
|
|
|
return _upsert_rows_by_demand_id(list(merged_rows.values()))
|
|
return _upsert_rows_by_demand_id(list(merged_rows.values()))
|
|
|
|
|
|