Skip to content

Commit

Permalink
Make error a warning just in case
Browse files Browse the repository at this point in the history
  • Loading branch information
courtneyholcomb committed Sep 26, 2024
1 parent 741fb2f commit 93e2219
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dbt_semantic_interfaces/validations/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def _validate_time_granularity_names(
continue
if time_dim_call_parameter_set.time_granularity_name not in valid_granularity_names:
issues.append(
ValidationError(
ValidationWarning(
context=context,
message=f"Filter for metric `{context.metric.metric_name}` is not valid. "
f"`{time_dim_call_parameter_set.time_granularity_name}` is not a valid granularity name. "
Expand Down
6 changes: 4 additions & 2 deletions tests/validations/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,10 @@ def test_where_filter_validations_invalid_granularity( # noqa: D
where_filters=[PydanticWhereFilter(where_sql_template="{{ TimeDimension('metric_time', 'cool') }}")]
)
validator = SemanticManifestValidator[PydanticSemanticManifest]([WhereFiltersAreParseable()])
with pytest.raises(SemanticManifestValidationException, match="`cool` is not a valid granularity name"):
validator.checked_validations(manifest)
issues = validator.validate_semantic_manifest(manifest)
assert not issues.has_blocking_issues
assert len(issues.warnings) == 1
assert "`cool` is not a valid granularity name" in issues.warnings[0].message


def test_conversion_metrics() -> None: # noqa: D
Expand Down

0 comments on commit 93e2219

Please sign in to comment.