Whole file
andialbrecht/sqlparse
The author described this change as “Fix Function.get_parameters(), add Funtion.get_window()”. It counts as a record because the check below fails on the code as it stood at 617b8f6cd and passes on e03b74e60, with nothing else changed between the two runs.
Projectandialbrecht/sqlparse
Fix saved2024-04-13
Sharing licenceBSD-3-Clause · LICENSE
Change size+8 −1
What the code was meant to do, written into the code itself as a save note
Fix Function.get_parameters(), add Funtion.get_window()
The change
| 623 | 623 | ||
| 624 | 624 | def get_parameters(self): | |
| 625 | 625 | """Return a list of parameters.""" | |
| 626 | - | parenthesis = self.tokens[-1] | |
| 626 | + | parenthesis = self.token_next_by(i=Parenthesis)[1] | |
| 627 | 627 | result = [] | |
| 628 | 628 | for token in parenthesis.tokens: | |
| 629 | 629 | if isinstance(token, IdentifierList): | |
| ⋯ | |||
| 632 | 632 | t=T.Literal): | |
| 633 | 633 | result.append(token) | |
| 634 | 634 | return result | |
| 635 | + | ||
| 636 | + | def get_window(self): | |
| 637 | + | """Return the window if it exists.""" | |
| 638 | + | over_clause = self.token_next_by(i=Over) | |
| 639 | + | if not over_clause: | |
| 640 | + | return None | |
| 641 | + | return over_clause[1].tokens[-1] | |
| 635 | 642 | ||
| 636 | 643 | ||
| 637 | 644 | class Begin(TokenList): | |
The check that tells the two apart
fail→pass·tests/test_grouping.py::test_grouping_function
Check file tests/test_grouping.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before it617b8f6cd3c55bacf2c80130901508518753f7e1
Broken version dated2024-04-13
Modulesqlparse.sql
Units changedFunction
Fingerprintc9c2bc1b1a19823e
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.
Other bugs found in andialbrecht/sqlparse
- 2026-07-25Fix get_real_name for names with more than two dotted parts (#332)
- 2026-07-22Fix function grouping skipped for lowercase 'as' in CREATE TABLE AS SELECT
- 2025-11-29StatementSplitter
- 2025-11-28StatementSplitter
- 2024-07-15StatementSplitter
- 2024-04-13Raise SQLParseError instead of RecursionError.