Whole file
kayak/pypika
The author described this change as “Fix is_aggregate property for Case fields.”. It counts as a record because the check below fails on the code as it stood at cb28b93e9 and passes on e805d9e05, with nothing else changed between the two runs.
Projectkayak/pypika
Fix saved2020-06-16
Sharing licenceApache-2.0 · LICENSE.txt
Change size+2 −2
What the code was meant to do, written into the code itself as a save note
Fix is_aggregate property for Case fields.
The change
| 974 | 974 | ||
| 975 | 975 | @property | |
| 976 | 976 | def is_aggregate(self) -> Optional[bool]: | |
| 977 | - | # True if all cases are True or None. None all cases are None. Otherwise, False | |
| 977 | + | # True if all criterions/cases are True or None. None all cases are None. Otherwise, False | |
| 978 | 978 | return resolve_is_aggregate( | |
| 979 | - | [term.is_aggregate for _, term in self._cases] | |
| 979 | + | [criterion.is_aggregate or term.is_aggregate for criterion, term in self._cases] | |
| 980 | 980 | + [self._else.is_aggregate if self._else else None] | |
| 981 | 981 | ) | |
| 982 | 982 |
The check that tells the two apart
fail→pass·pypika/tests/test_aggregate.py::IsAggregateTests::test__agg_case_criterion_is_aggregate
Check file pypika/tests/test_aggregate.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 itcb28b93e9c1159e490c3559e8467c7cfebb0ec5a
Broken version dated2020-05-26
Modulepypika.terms
Units changedCase
Fingerprint014a3cc88bb5c44a
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 kayak/pypika
- 2024-04-17fix `Field.__init__` (#742)
- 2023-09-26Fix: Allow the usage of `frozenset` in the `isin(...)` and `notin(...)` functions (#744)
- 2023-09-22fix(terms): fixed EmptyCriterion bug with ComplexCriterion (#732)
- 2021-08-26MySQLQuery
- 2021-01-11Fix empty Postgres array syntax (#539)
- 2021-01-04Fix PostgreSQLQueryBuilder returning clause code causing Py3.9 test failures