diff --git a/dbt_semantic_interfaces/parsing/schemas.py b/dbt_semantic_interfaces/parsing/schemas.py index dcc0a1cf..488d6067 100644 --- a/dbt_semantic_interfaces/parsing/schemas.py +++ b/dbt_semantic_interfaces/parsing/schemas.py @@ -4,6 +4,7 @@ from referencing.jsonschema import DRAFT7 from dbt_semantic_interfaces.parsing.schema_validator import SchemaValidator +from dbt_semantic_interfaces.type_enums import TimeGranularity TRANSFORM_OBJECT_NAME_PATTERN = "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$" @@ -34,8 +35,9 @@ window_aggregation_type_values = ["MIN", "MAX"] window_aggregation_type_values += [x.lower() for x in window_aggregation_type_values] -time_granularity_values = ["DAY", "WEEK", "MONTH", "QUARTER", "YEAR"] -time_granularity_values += [x.lower() for x in time_granularity_values] +time_granularity_values: List[str] = [] +for time_granularity in TimeGranularity: + time_granularity_values += [time_granularity.name, time_granularity.value] dimension_type_values = ["CATEGORICAL", "TIME"] dimension_type_values += [x.lower() for x in dimension_type_values] diff --git a/dbt_semantic_interfaces/test_utils.py b/dbt_semantic_interfaces/test_utils.py index addd1b93..ed006d33 100644 --- a/dbt_semantic_interfaces/test_utils.py +++ b/dbt_semantic_interfaces/test_utils.py @@ -98,7 +98,7 @@ def base_semantic_manifest_file() -> YamlConfigFile: - name: ds type: time type_params: - time_granularity: day + time_granularity: hour """ ) return YamlConfigFile(filepath="inline_for_test", contents=yaml_contents)