Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary check against legacy field #368

Merged
merged 2 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion dbt_semantic_interfaces/validations/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def validate_manifest(semantic_manifest: SemanticManifestT) -> Sequence[Validati
else None
)
if (
type_params_field_value
field == "window"
WilliamDee marked this conversation as resolved.
Show resolved Hide resolved
and type_params_field_value
and cumulative_type_params_field_value
and cumulative_type_params_field_value != type_params_field_value
):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "dbt-semantic-interfaces"
version = "0.8.0"
version = "0.8.1"
description = 'The shared semantic layer definitions that dbt-core and MetricFlow use'
readme = "README.md"
requires-python = ">=3.8"
Expand Down
15 changes: 1 addition & 14 deletions tests/validations/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,18 +614,6 @@ def test_cumulative_metrics() -> None: # noqa: D
),
),
),
# Metrics with duplicated window or grain_to_date - should get warning
metric_with_guaranteed_meta(
name="what_a_metric",
type=MetricType.CUMULATIVE,
type_params=PydanticMetricTypeParams(
measure=PydanticMetricInputMeasure(name=measure_name),
grain_to_date=TimeGranularity.YEAR,
cumulative_type_params=PydanticCumulativeTypeParams(
grain_to_date=TimeGranularity.HOUR.value,
),
),
),
metric_with_guaranteed_meta(
name="dis_bad",
type=MetricType.CUMULATIVE,
Expand Down Expand Up @@ -688,12 +676,11 @@ def test_cumulative_metrics() -> None: # noqa: D
)

build_issues = validation_results.all_issues
assert len(build_issues) == 4
assert len(build_issues) == 3
expected_substrings = [
"Invalid time granularity",
"Both window and grain_to_date set for cumulative metric. Please set one or the other.",
"Got differing values for `window`",
"Got differing values for `grain_to_date`",
]
check_error_in_issues(error_substrings=expected_substrings, issues=build_issues)

Expand Down
Loading