Skip to content

Commit 5709763

Browse files
committed
Add docstrings for the plan stages builder
1 parent aa973fa commit 5709763

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

sqlmesh/core/plan/stages.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,13 @@ class FinalizeEnvironmentStage:
196196

197197

198198
class PlanStagesBuilder:
199+
"""The builder for the plan stages.
200+
201+
Args:
202+
state_reader: The state reader to use to read the snapshots and environment.
203+
default_catalog: The default catalog to use for the snapshots.
204+
"""
205+
199206
def __init__(
200207
self,
201208
state_reader: StateReader,
@@ -205,6 +212,16 @@ def __init__(
205212
self.default_catalog = default_catalog
206213

207214
def build(self, plan: EvaluatablePlan) -> t.List[PlanStage]:
215+
"""Builds the plan stages for the given plan.
216+
217+
NOTE: Building the plan stages should NOT produce any side effects in the state or the data warehouse.
218+
219+
Args:
220+
plan: The plan to build the stages for.
221+
222+
Returns:
223+
A list of plan stages.
224+
"""
208225
new_snapshots = {s.snapshot_id: s for s in plan.new_snapshots}
209226
stored_snapshots = self.state_reader.get_snapshots(plan.environment.snapshots)
210227
snapshots = {**new_snapshots, **stored_snapshots}

0 commit comments

Comments
 (0)