Repository navigation
Sync sqlparse package fork - #12
Merged
Merged
Conversation
"3.10" must be quoted in yaml https://dev.to/hugovk/the-python-3-1-problem-85g
A subset of andialbrecht#645 Follow on to andialbrecht#661
Since we are working with indexes anyway, don't bother calling enumerate() with a slice from self.tokens (which requires copying memory). Instead, just generate the indexes using range() and use normal indexing to access the desired tokens. The old behavior resulted in quadratic runtime with respect to the number of tokens, which significantly impacted performance for statements with very large numbers of tokens. With the new behavior, the runtime is now linear with respect to the number of tokens.
yeah... I promise to make fewer commits like that in the future...
This reverts commit 28c4d40. See andialbrecht#694. The expectation is that IN is primarily recognized as a keyword, although it acts as a comparison operator. This also matches the definition of IN in most SQL syntax references where it is listed as a reserved keyword (PostgreSQL: https://www.postgresql.org/docs/current/sql-keywords-appendix.html, MySQL: https://dev.mysql.com/doc/refman/8.0/en/keywords.html, for example).
This reverts commit b253bb1.
par level should decrease when ')'
There are many functions that are implemented using recursion besides TokenList.flatten() that could raise RecursionError. Move the try/except block handling RecursionError from TokenList.flatten() to FilterStack.run() to avoid any of them resulting in an unwanted RecursionError.
Python 3.8 won't be supported with the next release. The pypy-3.8 causes problems already.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Doing some work to fix parsing of JOIN statements with
IFFclauses in Snowflake, where a query that containsJOIN X ON IFF(condition, table_1.x, table_1.y) = table_2.zwill parsetable_1.xandtable_1.yas tables.I needed to make a small update to the package, and thought this would be a good opportunity to sync in the upstream changes as it's been a few years.
Thanks for contributing!
Before submitting your pull request please have a look at the
following checklist:
pytest)flake8)In addition, please take care to provide a proper description
on what your change does, fixes or achieves when submitting the
pull request.