Skip to content

Commit

Permalink
fixing no_name_subquery
Browse files Browse the repository at this point in the history
zshandy committed Apr 8, 2024
1 parent 74aaad8 commit b2556d8
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions lineagex/ColumnLineageNoConn.py
Original file line number Diff line number Diff line change
@@ -288,12 +288,14 @@ def _sub_shared_col_conds(self, sql_ast: expressions = None) -> None:
# target_dict=temp_sub_dict,
# source_table=self.sub_tables,
# )
if sub_ast.find(exp.TableAlias).depth - sub_ast.depth > 1:
sub_name = "no_name_subquery"
sub_ast.replace(exp.Table(this=sub_name))
if sub_ast.find(exp.TableAlias) is not None:
if sub_ast.find(exp.TableAlias).depth - sub_ast.depth > 1:
sub_name = "no_name_subquery"
else:
sub_name = sub_ast.find(exp.TableAlias).alias_or_name
else:
sub_name = sub_ast.find(exp.TableAlias).alias_or_name
sub_ast.replace(exp.Table(this=sub_name))
sub_name = "no_name_subquery"
sub_ast.replace(exp.Table(this=sub_name))
self.cte_dict[sub_name] = temp_sub_dict
self._run_lineage(sub_ast, True)
sub_ast.pop()
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "lineagex"
version = "0.0.23"
version = "0.0.24"
description = "A column lineage tool"
authors = ["zshandy <[email protected]>"]
license = "MIT"

0 comments on commit b2556d8

Please sign in to comment.