Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add sqlglot to parse sql dataflow #3310

Merged
merged 16 commits into from
Dec 31, 2024
12 changes: 0 additions & 12 deletions tests/_ast/test_sql_visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,18 +626,6 @@ def test_find_sql_refs_nested_intersect() -> None:
"""
assert find_sql_refs(sql) == ["table2", "table3", "table4", "table1"]

@staticmethod
def test_find_sql_refs_with_recursive_cte() -> None:
sql = """
WITH RECURSIVE cte AS (
SELECT 1 AS n FROM table1
UNION ALL
SELECT n + 1 FROM cte WHERE n < 10
)
SELECT * FROM cte;
"""
assert find_sql_refs(sql) == ["table1"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is not yet supported, but you'd like to keep the test, you can decorate it with pytest.mark.xfail, as done here:

@pytest.mark.xfail(reason="Multiple CTEs are not supported")

Copy link
Collaborator Author

@Light2Dark Light2Dark Dec 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it does work, I didn't see the need for it since we have tested nested cte's. Also noted on the dialect change. I may add back the has_duckdb dependency too.

thanks!!


@staticmethod
def test_find_sql_refs_with_alias() -> None:
sql = "SELECT * FROM employees AS e;"
Expand Down
Loading