summaryrefslogtreecommitdiffstats
path: root/sqlglot/diff.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-08 04:14:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-08 04:14:34 +0000
commit8bec55350caa5c760d8b7e7e2d0ba6c77a32bc71 (patch)
treed6259e0351c7b4a50d528122513d533bb582eb2b /sqlglot/diff.py
parentReleasing debian version 10.6.0-1. (diff)
downloadsqlglot-8bec55350caa5c760d8b7e7e2d0ba6c77a32bc71.tar.xz
sqlglot-8bec55350caa5c760d8b7e7e2d0ba6c77a32bc71.zip
Merging upstream version 10.6.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sqlglot/diff.py')
-rw-r--r--sqlglot/diff.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/sqlglot/diff.py b/sqlglot/diff.py
index a5373b0..7d5ec21 100644
--- a/sqlglot/diff.py
+++ b/sqlglot/diff.py
@@ -14,10 +14,6 @@ from sqlglot import Dialect
from sqlglot import expressions as exp
from sqlglot.helper import ensure_collection
-if t.TYPE_CHECKING:
- T = t.TypeVar("T")
- Edit = t.Union[Insert, Remove, Move, Update, Keep]
-
@dataclass(frozen=True)
class Insert:
@@ -56,6 +52,11 @@ class Keep:
target: exp.Expression
+if t.TYPE_CHECKING:
+ T = t.TypeVar("T")
+ Edit = t.Union[Insert, Remove, Move, Update, Keep]
+
+
def diff(source: exp.Expression, target: exp.Expression) -> t.List[Edit]:
"""
Returns the list of changes between the source and the target expressions.