Skip to content

Commit 7bf6add

Browse files
committed
refactor: breaking up the console interface
1 parent 9940af0 commit 7bf6add

2 files changed

Lines changed: 9 additions & 11 deletions

File tree

sqlmesh/core/console.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,15 @@
8383
RED_X_MARK = "\u274c"
8484

8585

86-
class Console(abc.ABC, LinterConsole):
86+
class LinterConsole(abc.ABC):
87+
@abc.abstractmethod
88+
def show_linter_violations(
89+
self, violations: t.List[RuleViolation], model: Model, is_error: bool = False
90+
) -> None:
91+
"""Prints all linter violations depending on their severity"""
92+
93+
94+
class Console(LinterConsole, abc.ABC):
8795
"""Abstract base class for defining classes used for displaying information to the user and also interact
8896
with them when their input is needed."""
8997

@@ -401,14 +409,6 @@ def _limit_model_names(self, tree: Tree, verbosity: Verbosity = Verbosity.DEFAUL
401409
return tree
402410

403411

404-
class LinterConsole(abc.ABC):
405-
@abc.abstractmethod
406-
def show_linter_violations(
407-
self, violations: t.List[RuleViolation], model: Model, is_error: bool = False
408-
) -> None:
409-
"""Prints all linter violations depending on their severity"""
410-
411-
412412
class NoopConsole(Console):
413413
def start_plan_evaluation(self, plan: EvaluatablePlan) -> None:
414414
pass

sqlmesh/core/context.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2475,8 +2475,6 @@ def lint_models(
24752475
raise LinterError(
24762476
"Linter detected errors in the code. Please fix them before proceeding."
24772477
)
2478-
2479-
def _lint_models(s)
24802478

24812479
def load_model_tests(
24822480
self, tests: t.Optional[t.List[str]] = None, patterns: list[str] | None = None

0 commit comments

Comments
 (0)