Skip to content

Commit a7ffa1b

Browse files
Transform agg_time_dimension to lowercase (#379)
### Description Seeing an [error](https://dbtlabsmt.datadoghq.com/logs?query=env%3A%2Aprod%2A%20service%3Ametricflow-server%20%40levelname%3AERROR%20-%40channel%3Addtrace.internal.writer.writer%20-%22Exception%20in%20callback%20functools.partial%22%20-%22Unclosed%20connector%22%20-%22Unclosed%20client%20session%22&agg_m=count&agg_m_source=base&agg_t=count&clustering_pattern_field_path=message&cols=host%2Cservice&event=AwAAAZejI8GuonG5mgAAABhBWmVqSTlpTkFBQUJ3XzFKR0RCUHRRQUIAAAAkMDE5N2EzMjYtNWNhOC00ZWI2LWI1ODAtN2E5NDE1OTdjNWFkAAld9Q&fromUser=true&messageDisplay=inline&refresh_mode=sliding&saved-view-id=3577070&storage=hot&stream_sort=desc&viz=stream&from_ts=1750698965459&to_ts=1750785365459&live=true) in MetricFlow where we can't find the `agg_time_dimension` in the semantic model because it's uppercased in the `defaults` section but lowercased (by transformation, presumably) in the `dimensions` section. This will ensure both are lowercased. ### Checklist - [x] I have read [the contributing guide](https://github.com/dbt-labs/dbt-semantic-interfaces/blob/main/CONTRIBUTING.md) and understand what's expected of me - [x] I have signed the [CLA](https://docs.getdbt.com/docs/contributor-license-agreements) - [ ] This PR includes tests, or tests are not required/relevant for this PR - [x] I have run `changie new` to [create a changelog entry](https://github.com/dbt-labs/dbt-semantic-interfaces/blob/main/CONTRIBUTING.md#adding-a-changelog-entry)
1 parent 89fbe99 commit a7ffa1b

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
kind: Fixes
2+
body: Ensure agg_time_dimension is lowercased in the manifest
3+
time: 2025-06-24T12:50:00.951688-07:00
4+
custom:
5+
Author: courtneyholcomb
6+
Issue: "379"

dbt_semantic_interfaces/transformations/names.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ def _lowercase_semantic_model_elements(semantic_model: PydanticSemanticModel) ->
4141
if semantic_model.dimensions:
4242
for dimension in semantic_model.dimensions:
4343
dimension.name = dimension.name.lower()
44+
if semantic_model.defaults and semantic_model.defaults.agg_time_dimension:
45+
semantic_model.defaults.agg_time_dimension = semantic_model.defaults.agg_time_dimension.lower()
4446

4547
@staticmethod
4648
def _lowercase_top_level_objects(model: PydanticSemanticManifest) -> None:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "dbt-semantic-interfaces"
3-
version = "0.8.4"
3+
version = "0.8.5"
44
description = 'The shared semantic layer definitions that dbt-core and MetricFlow use'
55
readme = "README.md"
66
requires-python = ">=3.8"

0 commit comments

Comments
 (0)