Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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: 3 additions & 0 deletions .changes/unreleased/Fixes-20260521-210810.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: Fixes
body: Make grain optional (default None) in GroupByParam so categorical group_by dimensions do not require a grain field
time: 2026-05-21T21:08:10.518263-07:00
2 changes: 1 addition & 1 deletion dbtsl/api/shared/query_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class GroupByParam:

name: str
type: GroupByType
grain: Optional[str]
grain: Optional[str] = None


@dataclass(frozen=True)
Expand Down
5 changes: 5 additions & 0 deletions tests/query_test_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,9 @@
GroupByParam(name="metric_time", grain="week", type=GroupByType.DIMENSION),
],
},
# group by param object without grain (categorical dimension)
{
"metrics": ["order_total"],
"group_by": [GroupByParam(name="business_owner__acquisition_channel", type=GroupByType.DIMENSION)],
},
]
Loading