Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
courtneyholcomb committed Feb 26, 2024
1 parent 6124a27 commit 33c95b6
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,7 @@ def test_offset_metric_filter_and_query_have_different_granularities(
metric_names=("booking_fees_last_week_per_booker_this_week",),
group_by_names=("metric_time__month",),
where_constraint=PydanticWhereFilter(
where_sql_template=("{{ TimeDimension('metric_time', 'day') }} = '2020-01-01' ")
where_sql_template=("{{ TimeDimension('metric_time', 'day') }} = '2020-01-01'")
),
)
dataflow_plan = dataflow_plan_builder.build_plan(query_spec)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ def test_offset_metric_filter_and_query_have_different_granularities(
metric_names=("booking_fees_last_week_per_booker_this_week",),
group_by_names=("metric_time__month",),
where_constraint=PydanticWhereFilter(
where_sql_template=("{{ TimeDimension('metric_time', 'day') }} = '2020-01-01' ")
where_sql_template=("{{ TimeDimension('metric_time', 'day') }} = '2020-01-01'")
),
)
dataflow_plan = dataflow_plan_builder.build_plan(query_spec)
Expand All @@ -733,8 +733,3 @@ def test_offset_metric_filter_and_query_have_different_granularities(
sql_client=sql_client,
node=dataflow_plan.sink_output_nodes[0].parent_node,
)


# Dataflow plan is constructed properly
# Issue happens in JoinToTimeSpineNdoe
# we remove that column too soon? is that in DFP or DF to SQL?
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<!-- element_name='booking_fees_last_week_per_booker_this_week', -->
<!-- filter_specs=( -->
<!-- WhereFilterSpec( -->
<!-- where_sql="metric_time__day = '2020-01-01' ", -->
<!-- where_sql="metric_time__day = '2020-01-01'", -->
<!-- bind_parameters=SqlBindParameters(), -->
<!-- linkable_spec_set=LinkableSpecSet( -->
<!-- time_dimension_specs=( -->
Expand All @@ -34,7 +34,7 @@
<!-- element_name='booking_value', -->
<!-- filter_specs=( -->
<!-- WhereFilterSpec( -->
<!-- where_sql="metric_time__day = '2020-01-01' ", -->
<!-- where_sql="metric_time__day = '2020-01-01'", -->
<!-- bind_parameters=SqlBindParameters(), -->
<!-- linkable_spec_set=LinkableSpecSet( -->
<!-- time_dimension_specs=( -->
Expand All @@ -60,19 +60,19 @@
<WhereConstraintNode>
<!-- description = 'Constrain Output with WHERE' -->
<!-- node_id = NodeId(id_str='wcc_0') -->
<!-- where_condition = -->
<!-- WhereFilterSpec( -->
<!-- where_sql="metric_time__day = '2020-01-01' ", -->
<!-- bind_parameters=SqlBindParameters(), -->
<!-- linkable_spec_set=LinkableSpecSet( -->
<!-- time_dimension_specs=( -->
<!-- TimeDimensionSpec( -->
<!-- element_name='metric_time', -->
<!-- time_granularity=DAY, -->
<!-- ), -->
<!-- ), -->
<!-- ), -->
<!-- ) -->
<!-- where_condition = -->
<!-- WhereFilterSpec( -->
<!-- where_sql="metric_time__day = '2020-01-01'", -->
<!-- bind_parameters=SqlBindParameters(), -->
<!-- linkable_spec_set=LinkableSpecSet( -->
<!-- time_dimension_specs=( -->
<!-- TimeDimensionSpec( -->
<!-- element_name='metric_time', -->
<!-- time_granularity=DAY, -->
<!-- ), -->
<!-- ), -->
<!-- ), -->
<!-- ) -->
<FilterElementsNode>
<!-- description = -->
<!-- ("Pass Only Elements: ['booking_value', 'metric_time__month', " -->
Expand Down Expand Up @@ -113,24 +113,24 @@
<ComputeMetricsNode>
<!-- description = 'Compute Metrics via Expressions' -->
<!-- node_id = NodeId(id_str='cm_1') -->
<!-- metric_spec = -->
<!-- MetricSpec( -->
<!-- element_name='bookers', -->
<!-- filter_specs=( -->
<!-- WhereFilterSpec( -->
<!-- where_sql="metric_time__day = '2020-01-01' ", -->
<!-- bind_parameters=SqlBindParameters(), -->
<!-- linkable_spec_set=LinkableSpecSet( -->
<!-- time_dimension_specs=( -->
<!-- TimeDimensionSpec( -->
<!-- element_name='metric_time', -->
<!-- time_granularity=DAY, -->
<!-- ), -->
<!-- ), -->
<!-- ), -->
<!-- ), -->
<!-- ), -->
<!-- ) -->
<!-- metric_spec = -->
<!-- MetricSpec( -->
<!-- element_name='bookers', -->
<!-- filter_specs=( -->
<!-- WhereFilterSpec( -->
<!-- where_sql="metric_time__day = '2020-01-01'", -->
<!-- bind_parameters=SqlBindParameters(), -->
<!-- linkable_spec_set=LinkableSpecSet( -->
<!-- time_dimension_specs=( -->
<!-- TimeDimensionSpec( -->
<!-- element_name='metric_time', -->
<!-- time_granularity=DAY, -->
<!-- ), -->
<!-- ), -->
<!-- ), -->
<!-- ), -->
<!-- ), -->
<!-- ) -->
<AggregateMeasuresNode>
<!-- description = 'Aggregate Measures' -->
<!-- node_id = NodeId(id_str='am_1') -->
Expand All @@ -143,19 +143,19 @@
<WhereConstraintNode>
<!-- description = 'Constrain Output with WHERE' -->
<!-- node_id = NodeId(id_str='wcc_1') -->
<!-- where_condition = -->
<!-- WhereFilterSpec( -->
<!-- where_sql="metric_time__day = '2020-01-01' ", -->
<!-- bind_parameters=SqlBindParameters(), -->
<!-- linkable_spec_set=LinkableSpecSet( -->
<!-- time_dimension_specs=( -->
<!-- TimeDimensionSpec( -->
<!-- element_name='metric_time', -->
<!-- time_granularity=DAY, -->
<!-- ), -->
<!-- ), -->
<!-- ), -->
<!-- ) -->
<!-- where_condition = -->
<!-- WhereFilterSpec( -->
<!-- where_sql="metric_time__day = '2020-01-01'", -->
<!-- bind_parameters=SqlBindParameters(), -->
<!-- linkable_spec_set=LinkableSpecSet( -->
<!-- time_dimension_specs=( -->
<!-- TimeDimensionSpec( -->
<!-- element_name='metric_time', -->
<!-- time_granularity=DAY, -->
<!-- ), -->
<!-- ), -->
<!-- ), -->
<!-- ) -->
<FilterElementsNode>
<!-- description = -->
<!-- "Pass Only Elements: ['bookers', 'metric_time__month', 'metric_time__day']" -->
Expand Down

0 comments on commit 33c95b6

Please sign in to comment.