-
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
Conversation
Summary of ChangesHello @sinhasubham, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the stability and reliability of the project's testing infrastructure by addressing two critical issues. It ensures that all necessary dependencies are correctly installed during pre-release checks, preventing build failures. Additionally, it resolves a persistent flakiness in system tests by intelligently handling specific SQL command types that were causing errors in a parsing library, thereby improving the overall robustness of the test suite. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request addresses two issues: a pre-release dependency failure by adding cryptography to noxfile.py, and system test flakiness by adding a special check for RUN PARTITION commands in google/cloud/spanner_dbapi/parse_utils.py.
My review focuses on the correctness and maintainability of these changes. I've identified a potential issue in the regex used for RUN PARTITION which could lead to incorrect behavior in some edge cases. I've also suggested a small improvement in noxfile.py to add a comment for better clarity. Overall, the changes are good, but the suggested refinements will make the code more robust and easier to understand.
54d44fa to
cc772af
Compare
| 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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens with RUN PARTITION ? (so with a space at the end)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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.
add cryptography to prerelease dependencies
The prerelease dependency check installs packages with
--no-deps, which causesgoogle-authto fail because its dependencycryptographyandcffiis missing. This change explicitly addscryptographyandcffito theprerel_depslist innoxfile.pyto ensure it is installed during the test session.bypass sqlparse for RUN PARTITION commands
Check for RUN PARTITION command to avoid sqlparse processing it. sqlparse fails with "Maximum grouping depth exceeded" on long partition IDs causing flakiness in system tests.