Skip to content

Commit

Permalink
git sync
Browse files Browse the repository at this point in the history
  • Loading branch information
DevonFulcher committed Oct 31, 2024
2 parents 8568b4f + 8a17a0d commit 2071399
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changes/unreleased/Under the Hood-20241031-093251.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Under the Hood
body: Behavior change for mf timespine without yaml configuration
time: 2024-10-31T09:32:51.166594-05:00
custom:
Author: DevonFulcher
Issue: "10959"
16 changes: 16 additions & 0 deletions core/dbt/contracts/graph/semantic_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,22 @@ def validate(self) -> bool:

validator = SemanticManifestValidator[PydanticSemanticManifest]()
validation_results = validator.validate_semantic_manifest(semantic_manifest)
time_spines = semantic_manifest.project_configuration.time_spines
legacy_time_spines = (
semantic_manifest.project_configuration.time_spine_table_configurations
)
# If the time spine contains a day grain then it is functionally equivalent to the legacy time spine.
time_spines_contain_day = any(
c for c in time_spines if c.primary_column.time_granularity == TimeGranularity.DAY
)
if (
get_flags().require_yaml_configuration_for_mf_time_spines is False
and legacy_time_spines
and not time_spines_contain_day
):
deprecations.warn(
"mf-timespine-without-yaml-configuration",
)

for warning in validation_results.warnings:
fire_event(SemanticValidationFailure(msg=warning.message))
Expand Down

0 comments on commit 2071399

Please sign in to comment.