Skip to content

Commit

Permalink
Rename convert_to_sql_query_plan.
Browse files Browse the repository at this point in the history
  • Loading branch information
plypaul committed Dec 18, 2024
1 parent 152bcc6 commit 3e2296a
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion metricflow/execution/dataflow_to_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def __init__(

def _convert_to_sql_plan(self, node: DataflowPlanNode) -> ConvertToSqlPlanResult:
logger.debug(LazyFormat(lambda: f"Generating SQL query plan from {node.node_id}"))
result = self._sql_plan_converter.convert_to_sql_query_plan(
result = self._sql_plan_converter.convert_to_sql_plan(
sql_engine_type=self._sql_client.sql_engine_type,
optimization_level=self._optimization_level,
dataflow_plan_node=node,
Expand Down
2 changes: 1 addition & 1 deletion metricflow/plan_conversion/dataflow_to_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def __init__(
def column_association_resolver(self) -> ColumnAssociationResolver: # noqa: D102
return self._column_association_resolver

def convert_to_sql_query_plan(
def convert_to_sql_plan(
self,
sql_engine_type: SqlEngine,
dataflow_plan_node: DataflowPlanNode,
Expand Down
2 changes: 1 addition & 1 deletion metricflow/validation/data_warehouse_model_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def renderize(
sql_client: SqlClient, plan_converter: DataflowToSqlPlanConverter, plan_id: str, nodes: FilterElementsNode
) -> Tuple[str, SqlBindParameterSet]:
"""Generates a sql query plan and returns the rendered sql and bind_parameter_set."""
conversion_result = plan_converter.convert_to_sql_query_plan(
conversion_result = plan_converter.convert_to_sql_plan(
sql_engine_type=sql_client.sql_engine_type,
dataflow_plan_node=nodes,
)
Expand Down
4 changes: 2 additions & 2 deletions tests_metricflow/examples/test_node_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def test_view_sql_generated_at_a_node(
# Show SQL and spec set at a source node.
bookings_source_data_set = to_data_set_converter.create_sql_source_data_set(bookings_semantic_model)
read_source_node = ReadSqlSourceNode.create(bookings_source_data_set)
conversion_result = to_sql_plan_converter.convert_to_sql_query_plan(
conversion_result = to_sql_plan_converter.convert_to_sql_plan(
sql_engine_type=sql_client.sql_engine_type,
dataflow_plan_node=read_source_node,
)
Expand Down Expand Up @@ -81,7 +81,7 @@ def test_view_sql_generated_at_a_node(
),
),
)
conversion_result = to_sql_plan_converter.convert_to_sql_query_plan(
conversion_result = to_sql_plan_converter.convert_to_sql_plan(
sql_engine_type=sql_client.sql_engine_type,
dataflow_plan_node=filter_elements_node,
)
Expand Down
4 changes: 2 additions & 2 deletions tests_metricflow/plan_conversion/test_dataflow_to_sql_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def convert_and_check(
) -> None:
"""Convert the dataflow plan to SQL and compare with snapshots."""
# Generate plans w/o optimizers
conversion_result = dataflow_to_sql_converter.convert_to_sql_query_plan(
conversion_result = dataflow_to_sql_converter.convert_to_sql_plan(
sql_engine_type=sql_client.sql_engine_type,
sql_query_plan_id=DagId.from_str("plan0"),
dataflow_plan_node=node,
Expand All @@ -91,7 +91,7 @@ def convert_and_check(
)

# Generate plans with optimizers
conversion_result = dataflow_to_sql_converter.convert_to_sql_query_plan(
conversion_result = dataflow_to_sql_converter.convert_to_sql_plan(
sql_engine_type=sql_client.sql_engine_type,
sql_query_plan_id=DagId.from_str("plan0_optimized"),
dataflow_plan_node=node,
Expand Down
4 changes: 2 additions & 2 deletions tests_metricflow/query_rendering/compare_rendered_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def render_and_check(
base_plan = dataflow_plan_builder.build_plan_for_distinct_values(query_spec=query_spec)
else:
base_plan = dataflow_plan_builder.build_plan(query_spec)
conversion_result = dataflow_to_sql_converter.convert_to_sql_query_plan(
conversion_result = dataflow_to_sql_converter.convert_to_sql_plan(
sql_engine_type=sql_client.sql_engine_type,
dataflow_plan_node=base_plan.sink_node,
optimization_level=SqlOptimizationLevel.O0,
Expand Down Expand Up @@ -60,7 +60,7 @@ def render_and_check(
optimized_plan = dataflow_plan_builder.build_plan(
query_spec, optimizations=DataflowPlanOptimization.enabled_optimizations()
)
conversion_result = dataflow_to_sql_converter.convert_to_sql_query_plan(
conversion_result = dataflow_to_sql_converter.convert_to_sql_plan(
sql_engine_type=sql_client.sql_engine_type,
dataflow_plan_node=optimized_plan.sink_node,
sql_query_plan_id=DagId.from_str("plan0_optimized"),
Expand Down

0 comments on commit 3e2296a

Please sign in to comment.