|
11 | 11 | from sqlmesh.core import constants as c |
12 | 12 | from sqlmesh.core.console import Console, TerminalConsole, get_console |
13 | 13 | from sqlmesh.core.environment import EnvironmentNamingInfo |
14 | | -from sqlmesh.core.snapshot.definition import model_display_name |
15 | 14 | from sqlmesh.core.plan.common import ( |
16 | 15 | SnapshotIntervalClearRequest, |
17 | 16 | identify_restatement_intervals_across_snapshot_versions, |
|
22 | 21 | PlanEvaluator, |
23 | 22 | ) |
24 | 23 | from sqlmesh.core.state_sync import StateReader |
25 | | -from sqlmesh.core.snapshot.definition import SnapshotInfoMixin, SnapshotNameVersionLike |
| 24 | +from sqlmesh.core.snapshot.definition import SnapshotInfoMixin, SnapshotIdAndVersion |
26 | 25 | from sqlmesh.utils import Verbosity, rich as srich, to_snake_case |
27 | 26 | from sqlmesh.utils.date import to_ts |
28 | 27 | from sqlmesh.utils.errors import SQLMeshError |
@@ -323,22 +322,17 @@ def visit_finalize_environment_stage( |
323 | 322 |
|
324 | 323 | def _display_name( |
325 | 324 | self, |
326 | | - snapshot: t.Union[SnapshotInfoMixin, SnapshotNameVersionLike], |
| 325 | + snapshot: t.Union[SnapshotInfoMixin, SnapshotIdAndVersion], |
327 | 326 | environment_naming_info: t.Optional[EnvironmentNamingInfo] = None, |
328 | 327 | ) -> str: |
329 | | - naming_kwargs: t.Any = dict( |
| 328 | + return snapshot.display_name( |
330 | 329 | environment_naming_info=environment_naming_info or self.environment_naming_info, |
331 | 330 | default_catalog=self.default_catalog |
332 | 331 | if self.verbosity < Verbosity.VERY_VERBOSE |
333 | 332 | else None, |
334 | 333 | dialect=self.dialect, |
335 | 334 | ) |
336 | 335 |
|
337 | | - if isinstance(snapshot, SnapshotInfoMixin): |
338 | | - return snapshot.display_name(**naming_kwargs) |
339 | | - |
340 | | - return model_display_name(node_name=snapshot.name, **naming_kwargs) |
341 | | - |
342 | 336 | def _limit_tree(self, tree: Tree) -> Tree: |
343 | 337 | tree_length = len(tree.children) |
344 | 338 | if tree_length <= MAX_TREE_LENGTH: |
|
0 commit comments