Skip to content

Commit

Permalink
Merge pull request #1206 from DataJunction/DJ-108
Browse files Browse the repository at this point in the history
Add lookback window to Materialization calls.
  • Loading branch information
agorajek authored Oct 17, 2024
2 parents 9ed081f + 0df280b commit c845c8a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def schedule(
partitions=temporal_partition + categorical_partitions,
job=materialization.job,
strategy=materialization.strategy,
lookback_window=cube_config.lookback_window,
),
request_headers=request_headers,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ class GenericMaterializationInput(BaseModel):
spark_conf: Optional[Dict] = None
partitions: Optional[List[Dict]] = None
columns: List[ColumnMetadata]
lookback_window: Optional[str] = "1 DAY"


class DruidMaterializationInput(GenericMaterializationInput):
Expand Down
2 changes: 2 additions & 0 deletions datajunction-server/tests/service_clients_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ def test_query_service_client_materialize(self, mocker: MockerFixture) -> None:
"spark_conf": {},
"upstream_tables": ["default.hard_hats"],
"columns": [],
"lookback_window": "1 DAY",
},
headers=ANY,
)
Expand Down Expand Up @@ -544,6 +545,7 @@ def test_materialize(self, mocker: MockerFixture) -> None:
json={
"name": "default",
"job": "SparkSqlMaterializationJob",
"lookback_window": "1 DAY",
"strategy": "full",
"node_name": "default.hard_hat",
"node_version": "v1",
Expand Down

0 comments on commit c845c8a

Please sign in to comment.