Merging upstream version 10.5.10.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
8588db6332
commit
4d496b7a6a
43 changed files with 1384 additions and 356 deletions
20
tests/test_lineage.py
Normal file
20
tests/test_lineage.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
import unittest
|
||||
|
||||
from sqlglot.lineage import lineage
|
||||
|
||||
|
||||
class TestLineage(unittest.TestCase):
|
||||
maxDiff = None
|
||||
|
||||
def test_lineage(self) -> None:
|
||||
node = lineage(
|
||||
"a",
|
||||
"SELECT a FROM y",
|
||||
schema={"x": {"a": "int"}},
|
||||
sources={"y": "SELECT * FROM x"},
|
||||
)
|
||||
self.assertEqual(
|
||||
node.source.sql(),
|
||||
"SELECT y.a AS a FROM (SELECT x.a AS a FROM x AS x) AS y /* source: y */",
|
||||
)
|
||||
self.assertGreater(len(node.to_html()._repr_html_()), 1000)
|
Loading…
Add table
Add a link
Reference in a new issue