From 45cf01f49d108c9c43409c0a1378a9b8fefa81e7 Mon Sep 17 00:00:00 2001 From: tlento Date: Tue, 21 May 2024 15:33:53 -0700 Subject: [PATCH] Namespace dataflow plan subgraphs by prefix --- metricflow-semantics/metricflow_semantics/dag/id_prefix.py | 1 + metricflow/dataflow/dataflow_plan.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/metricflow-semantics/metricflow_semantics/dag/id_prefix.py b/metricflow-semantics/metricflow_semantics/dag/id_prefix.py index bfe85ae8bc..ceea1ddef9 100644 --- a/metricflow-semantics/metricflow_semantics/dag/id_prefix.py +++ b/metricflow-semantics/metricflow_semantics/dag/id_prefix.py @@ -89,6 +89,7 @@ class StaticIdPrefix(IdPrefix, Enum, metaclass=EnumMetaClassHelper): VALUES_GROUP_BY_ITEM_RESOLUTION_NODE = "vr" DATAFLOW_PLAN_PREFIX = "dfp" + DATAFLOW_PLAN_SUBGRAPH_PREFIX = "dfpsub" OPTIMIZED_DATAFLOW_PLAN_PREFIX = "dfpo" SQL_QUERY_PLAN_PREFIX = "sqp" EXEC_PLAN_PREFIX = "ep" diff --git a/metricflow/dataflow/dataflow_plan.py b/metricflow/dataflow/dataflow_plan.py index 2f8bdb2094..e110df0719 100644 --- a/metricflow/dataflow/dataflow_plan.py +++ b/metricflow/dataflow/dataflow_plan.py @@ -78,7 +78,9 @@ def as_plan(self) -> DataflowPlan: inside of each node, we make those properties of the DataflowPlan, and this node-level converter makes such properties easily accessible. """ - return DataflowPlan(sink_nodes=(self,)) + return DataflowPlan( + sink_nodes=(self,), plan_id=DagId.from_id_prefix(id_prefix=StaticIdPrefix.DATAFLOW_PLAN_SUBGRAPH_PREFIX) + ) @abstractmethod def accept(self, visitor: DataflowPlanNodeVisitor[VisitorOutputT]) -> VisitorOutputT: