Skip to content

Commit

Permalink
Hide deprecation behind flag
Browse files Browse the repository at this point in the history
  • Loading branch information
DevonFulcher committed Oct 23, 2024
1 parent 788efe8 commit c6ac260
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions core/dbt/contracts/graph/semantic_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,18 @@ def validate(self) -> bool:

semantic_manifest = self._get_pydantic_semantic_manifest()

metrics_using_old_params: Set[str] = set()
for metric in semantic_manifest.metrics or []:
for field in ("window", "grain_to_date"):
type_params_field_value = getattr(metric.type_params, field)
# Warn that the old type_params structure has been deprecated.
if type_params_field_value:
metrics_using_old_params.add(metric.name)
if metrics_using_old_params:
deprecations.warn(
"mf-cumulative-type-params-deprecation",
)
if get_flags().allow_legacy_mf_cumulative_type_params is False:
metrics_using_old_params: Set[str] = set()
for metric in semantic_manifest.metrics or []:
for field in ("window", "grain_to_date"):
type_params_field_value = getattr(metric.type_params, field)
# Warn that the old type_params structure has been deprecated.
if type_params_field_value:
metrics_using_old_params.add(metric.name)
if metrics_using_old_params:
deprecations.warn(
"mf-cumulative-type-params-deprecation",
)

new_time_spines = semantic_manifest.project_configuration.time_spines
old_time_spines = semantic_manifest.project_configuration.time_spine_table_configurations
Expand Down

0 comments on commit c6ac260

Please sign in to comment.