|
| 1 | +import logging |
1 | 2 | import typing as t |
2 | | -from typing import Dict, Union, Callable |
3 | | -from dataclasses import dataclass |
4 | | -import uuid |
5 | 3 | import unittest |
6 | | -import logging |
| 4 | +import uuid |
| 5 | +from dataclasses import dataclass |
| 6 | +from typing import Callable, Dict, Union |
7 | 7 |
|
8 | 8 | from sqlglot.expressions import Alter |
9 | 9 | from sqlmesh.core.console import Console |
10 | | -from sqlmesh.core.plan import EvaluatablePlan |
11 | 10 | from sqlmesh.core.context_diff import ContextDiff |
12 | | -from sqlmesh.core.plan import PlanBuilder |
13 | | -from sqlmesh.core.table_diff import RowDiff, SchemaDiff, TableDiff |
14 | 11 | from sqlmesh.core.environment import EnvironmentNamingInfo |
| 12 | +from sqlmesh.core.linter.rule import RuleViolation |
| 13 | +from sqlmesh.core.plan import EvaluatablePlan, PlanBuilder |
15 | 14 | from sqlmesh.core.snapshot import ( |
16 | 15 | Snapshot, |
17 | 16 | SnapshotChangeCategory, |
18 | 17 | SnapshotInfoLike, |
19 | 18 | ) |
| 19 | +from sqlmesh.core.table_diff import RowDiff, SchemaDiff, TableDiff |
20 | 20 | from sqlmesh.utils.concurrency import NodeExecutionFailedError |
21 | 21 |
|
22 | 22 | logger = logging.getLogger(__name__) |
@@ -562,6 +562,12 @@ def print_environments(self, environments_summary: t.Dict[str, int]) -> None: |
562 | 562 | def show_table_diff_summary(self, table_diff: TableDiff) -> None: |
563 | 563 | self.publish(ShowTableDiffSummary(table_diff)) |
564 | 564 |
|
| 565 | + def show_linter_violations( |
| 566 | + self, |
| 567 | + violations: list[RuleViolation], |
| 568 | + ) -> None: |
| 569 | + self.publish(LogWarning("Linting violations found", str(violations))) |
| 570 | + |
565 | 571 |
|
566 | 572 | class DebugEventConsole(EventConsole): |
567 | 573 | """A console that wraps an existing console and logs all events to a logger""" |
|
0 commit comments