Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
courtneyholcomb committed May 12, 2024
1 parent a7227f1 commit a714e4e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -533,8 +533,6 @@ def _resolve_query(self, resolver_input_for_query: ResolverInputForQuery) -> Met
semantic_models_in_group_by_items = set(
resolve_group_by_item_result.linkable_element_set.derived_from_semantic_models
)
print(resolve_group_by_item_result.linkable_element_set)
print(semantic_models_in_group_by_items)
semantic_models_in_filters = set(
itertools.chain.from_iterable(
filter_spec_resolution.resolved_linkable_element_set.derived_from_semantic_models
Expand Down
15 changes: 6 additions & 9 deletions metricflow/dataflow/builder/dataflow_plan_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -835,8 +835,6 @@ def _find_dataflow_recipe(
else:
candidate_nodes_for_right_side_of_join += list(self._source_node_set.source_nodes_for_group_by_item_queries)
candidate_nodes_for_left_side_of_join += list(
# Narrow to those where entity is primary key, if applicable? seems wrong.
# What happens if we query just 'listing'?
self._select_source_nodes_with_linkable_specs(
linkable_specs=linkable_spec_set,
source_nodes=self._source_node_set.source_nodes_for_group_by_item_queries,
Expand Down Expand Up @@ -912,7 +910,6 @@ def _find_dataflow_recipe(
# Dict from the node that contains the source node to the evaluation results.
node_to_evaluation: Dict[DataflowPlanNode, LinkableInstanceSatisfiabilityEvaluation] = {}

# We no longer sort by joins required? Is that the problem?
for node in self._sort_by_suitability(candidate_nodes_for_left_side_of_join):
data_set = self._node_data_set_resolver.get_output_data_set(node)

Expand Down Expand Up @@ -1402,12 +1399,12 @@ def _build_aggregated_measure_from_measure_source_node(
if non_additive_dimension_spec is not None:
# Apply semi additive join on the node
agg_time_dimension = measure_properties.agg_time_dimension
queried_time_dimension_spec: Optional[TimeDimensionSpec] = (
self._find_non_additive_dimension_in_linkable_specs(
agg_time_dimension=agg_time_dimension,
linkable_specs=queried_linkable_specs.as_tuple,
non_additive_dimension_spec=non_additive_dimension_spec,
)
queried_time_dimension_spec: Optional[
TimeDimensionSpec
] = self._find_non_additive_dimension_in_linkable_specs(
agg_time_dimension=agg_time_dimension,
linkable_specs=queried_linkable_specs.as_tuple,
non_additive_dimension_spec=non_additive_dimension_spec,
)
time_dimension_spec = TimeDimensionSpec.from_name(non_additive_dimension_spec.name)
window_groupings = tuple(
Expand Down
3 changes: 0 additions & 3 deletions tests_metricflow/integration/test_cases/itest_dimensions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,6 @@ integration_test:
name: distinct_values_query_with_metric_filter
description: Query without metrics using a metric filter
model: SIMPLE_MODEL
# How do we specify that we want listing from the listings table?
# When querying entities, should we prioritize using tables where the entity is a primary key (if not specified)?
# Are we prioritizing the left node appropriately in the DFP for distinct values queries?
group_bys: ["listing"]
where_filter: "{{ render_metric_template('bookings', ['listing']) }} > 2"
check_query: |
Expand Down

0 comments on commit a714e4e

Please sign in to comment.