Skip to content

Commit

Permalink
Enable sub-daily granularity in YAML spec
Browse files Browse the repository at this point in the history
  • Loading branch information
courtneyholcomb committed Jun 1, 2024
1 parent 881fd53 commit 8e09d89
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions dbt_semantic_interfaces/parsing/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]$"

Expand Down Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion dbt_semantic_interfaces/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8e09d89

Please sign in to comment.