File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -2810,6 +2810,9 @@ def render_field_value(value: t.Any) -> t.Any:
2810
2810
for key , value in field_value .items ():
2811
2811
if key in RUNTIME_RENDERED_MODEL_FIELDS :
2812
2812
rendered_dict [key ] = parse_strings_with_macro_refs (value , dialect )
2813
+ elif key == "auto_restatement_cron" :
2814
+ # Don't parse auto_restatement_cron="@..." kwarg (e.g. @daily) into MacroVar
2815
+ rendered_dict [key ] = value
2813
2816
elif (rendered := render_field_value (value )) is not None :
2814
2817
rendered_dict [key ] = rendered
2815
2818
Original file line number Diff line number Diff line change @@ -2881,7 +2881,15 @@ def my_model_2(context):
2881
2881
# no warning with valid kind dict
2882
2882
with patch .object (get_console (), "log_warning" ) as mock_logger :
2883
2883
2884
- @model ("kind_valid_dict" , kind = dict (name = ModelKindName .FULL ), columns = {'"COL"' : "int" })
2884
+ @model (
2885
+ "kind_valid_dict" ,
2886
+ kind = dict (
2887
+ name = ModelKindName .INCREMENTAL_BY_TIME_RANGE ,
2888
+ time_column = "ds" ,
2889
+ auto_restatement_cron = "@hourly" ,
2890
+ ),
2891
+ columns = {'"ds"' : "date" , '"COL"' : "int" },
2892
+ )
2885
2893
def my_model (context ):
2886
2894
pass
2887
2895
@@ -2890,7 +2898,7 @@ def my_model(context):
2890
2898
path = Path ("." ),
2891
2899
)
2892
2900
2893
- assert isinstance (python_model .kind , FullKind )
2901
+ assert isinstance (python_model .kind , IncrementalByTimeRangeKind )
2894
2902
2895
2903
assert not mock_logger .call_args
2896
2904
You can’t perform that action at this time.
0 commit comments