Skip to content

Commit

Permalink
WIP - dimension values for metric_time
Browse files Browse the repository at this point in the history
  • Loading branch information
courtneyholcomb committed Nov 8, 2023
1 parent 9db0fe0 commit b5e6110
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
4 changes: 3 additions & 1 deletion metricflow/dataflow/builder/dataflow_plan_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,10 +487,12 @@ def _find_dataflow_recipe(
)
else:
# Only read nodes can be source nodes for queries without measures
source_nodes = self._read_nodes
source_nodes = list(self._read_nodes)
source_nodes_to_linkable_specs = self._select_read_nodes_with_linkable_specs(
linkable_specs=linkable_spec_set, read_nodes=source_nodes
)
# Add time_spine to potential source nodes w/ metric_time as linkable spec
# Maybe only do this if requested
potential_source_nodes = list(source_nodes_to_linkable_specs.keys())

logger.info(f"There are {len(potential_source_nodes)} potential source nodes")
Expand Down
24 changes: 24 additions & 0 deletions metricflow/test/integration/test_cases/itest_dimensions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,27 @@ integration_test:
WHERE u.home_state = 'CA'
GROUP BY
u.home_state
---
integration_test:
name: metric_time_only
description: Query metric_time alone
model: SIMPLE_MODEL
group_bys: ["metric_time"]
check_query: |
SELECT 1
---
integration_test:
name: metric_time_week
description: Query metric_time alone with non-default granularity
model: SIMPLE_MODEL
group_bys: ["metric_time__week"]
check_query: |
SELECT 1
---
integration_test:
name: multiple_dimensions_with_metric_time
description: Query metric_time along with a different dimension
model: SIMPLE_MODEL
group_bys: ["metric_time", "booking__monthly_ds"]
check_query: |
SELECT 1

0 comments on commit b5e6110

Please sign in to comment.