summaryrefslogtreecommitdiffstats
path: root/tests/test_lineage.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 05:35:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 05:35:55 +0000
commitfe979e8421c04c038353a0a2d07d81779516186a (patch)
treeefb70a52261e5cf4862a7eb69e1d7cd16356fcba /tests/test_lineage.py
parentReleasing debian version 23.13.7-1. (diff)
downloadsqlglot-fe979e8421c04c038353a0a2d07d81779516186a.tar.xz
sqlglot-fe979e8421c04c038353a0a2d07d81779516186a.zip
Merging upstream version 23.16.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_lineage.py')
-rw-r--r--tests/test_lineage.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_lineage.py b/tests/test_lineage.py
index 3e17f95..036f146 100644
--- a/tests/test_lineage.py
+++ b/tests/test_lineage.py
@@ -487,3 +487,11 @@ class TestLineage(unittest.TestCase):
downstream = node.downstream[0]
self.assertEqual(downstream.name, "z.a")
self.assertEqual(downstream.source.sql(), "SELECT y.a AS a, y.b AS b, y.c AS c FROM y AS y")
+
+ def test_node_name_doesnt_contain_comment(self) -> None:
+ sql = "SELECT * FROM (SELECT x /* c */ FROM t1) AS t2"
+ node = lineage("x", sql)
+
+ self.assertEqual(len(node.downstream), 1)
+ self.assertEqual(len(node.downstream[0].downstream), 1)
+ self.assertEqual(node.downstream[0].downstream[0].name, "t1.x")