|
| 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__)
|
@@ -559,6 +559,12 @@ def print_environments(self, environments_summary: t.Dict[str, int]) -> None:
|
559 | 559 | def show_table_diff_summary(self, table_diff: TableDiff) -> None:
|
560 | 560 | self.publish(ShowTableDiffSummary(table_diff))
|
561 | 561 |
|
| 562 | + def show_linter_violations( |
| 563 | + self, |
| 564 | + violations: list[RuleViolation], |
| 565 | + ) -> None: |
| 566 | + self.publish(LogWarning("Linting violations found", str(violations))) |
| 567 | + |
562 | 568 |
|
563 | 569 | class DebugEventConsole(EventConsole):
|
564 | 570 | """A console that wraps an existing console and logs all events to a logger"""
|
|
0 commit comments