-
Notifications
You must be signed in to change notification settings - Fork 99
fix: resolve pre-release dependency failures and sqlparse recursion #1472
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -200,6 +200,29 @@ def test_run_partition_classify_stmt(self): | |
| ), | ||
| ) | ||
|
|
||
| def test_run_partition_classify_stmt_long_id(self): | ||
| # Regression test for "Maximum grouping depth exceeded" with sqlparse | ||
| long_id = "a" * 5000 | ||
| query = f"RUN PARTITION {long_id}" | ||
| parsed_statement = classify_statement(query) | ||
| self.assertEqual( | ||
| parsed_statement, | ||
| ParsedStatement( | ||
| StatementType.CLIENT_SIDE, | ||
| Statement(query), | ||
| ClientSideStatementType.RUN_PARTITION, | ||
| [long_id], | ||
| ), | ||
| ) | ||
|
|
||
| def test_run_partition_classify_stmt_incomplete(self): | ||
| # "RUN PARTITION" without ID should be classified as UNKNOWN (not None) | ||
| # because it falls through the specific check and sqlparse handles it. | ||
| query = "RUN PARTITION" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What happens with
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the query is just RUN PARTITION (with a trailing space), it fails the regex requirement because there are no characters after the trailing space and falls through to sqlparse. In this test_run_partition_classify_stmt_incomplete test, I've confirmed this results in StatementType.UNKNOWN, which is consistent with how other incomplete commands are handled. Let me know if you want me to add a unit test to cover this specific case. |
||
| parsed_statement = classify_statement(query) | ||
| self.assertEqual(parsed_statement.statement_type, StatementType.UNKNOWN) | ||
| self.assertEqual(parsed_statement.statement.sql, query) | ||
|
|
||
| def test_run_partitioned_query_classify_stmt(self): | ||
| parsed_statement = classify_statement( | ||
| " RUN PARTITIONED QUERY SELECT s.SongName FROM Songs AS s " | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.