Skip to content

Commit

Permalink
Test rendering for conversion metric filter
Browse files Browse the repository at this point in the history
  • Loading branch information
courtneyholcomb committed May 8, 2024
1 parent 3826db8 commit fab089a
Show file tree
Hide file tree
Showing 3 changed files with 704 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests_metricflow/query_rendering/test_metric_filter_rendering.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,3 +306,32 @@ def test_group_by_has_local_entity_prefix2( # noqa: D103
sql_client=sql_client,
node=dataflow_plan.sink_output_nodes[0].parent_node,
)


@pytest.mark.sql_engine_snapshot
def test_filter_with_conversion_metric( # noqa: D103
request: FixtureRequest,
mf_test_configuration: MetricFlowTestConfiguration,
dataflow_plan_builder: DataflowPlanBuilder,
sql_client: SqlClient,
dataflow_to_sql_converter: DataflowToSqlQueryPlanConverter,
query_parser: MetricFlowQueryParser,
) -> None:
query_spec = query_parser.parse_and_validate_query(
metric_names=("listings",),
where_constraint=PydanticWhereFilter(
where_sql_template="{{ Metric('visit_buy_conversion_rate', ['user']) }} > 2",
),
)
dataflow_plan = dataflow_plan_builder.build_plan(query_spec)

convert_and_check(
request=request,
mf_test_configuration=mf_test_configuration,
dataflow_to_sql_converter=dataflow_to_sql_converter,
sql_client=sql_client,
node=dataflow_plan.sink_output_nodes[0].parent_node,
)


# Then get some ACTUAL MULTIHOP OPTIONS!!!
Loading

0 comments on commit fab089a

Please sign in to comment.