Whole file
kayak/pypika
The author described this change as “Fix: Allow the usage of `frozenset` in the `isin(...)` and `notin(...)` functions (#744)”. It counts as a record because the check below fails on the code as it stood at 5087884bb and passes on 351981a69, with nothing else changed between the two runs.
Projectkayak/pypika
Fix saved2023-09-26
Sharing licenceApache-2.0 · LICENSE.txt
Change size+3 −3
What the code was meant to do, written into the code itself as a save note
Fix: Allow the usage of `frozenset` in the `isin(...)` and `notin(...)` functions (#744)
The change
| 184 | 184 | def all_(self) -> "All": | |
| 185 | 185 | return All(self) | |
| 186 | 186 | ||
| 187 | - | def isin(self, arg: Union[list, tuple, set, "Term"]) -> "ContainsCriterion": | |
| 188 | - | if isinstance(arg, (list, tuple, set)): | |
| 187 | + | def isin(self, arg: Union[list, tuple, set, frozenset, "Term"]) -> "ContainsCriterion": | |
| 188 | + | if isinstance(arg, (list, tuple, set, frozenset)): | |
| 189 | 189 | return ContainsCriterion(self, Tuple(*[self.wrap_constant(value) for value in arg])) | |
| 190 | 190 | return ContainsCriterion(self, arg) | |
| 191 | 191 | ||
| 192 | - | def notin(self, arg: Union[list, tuple, set, "Term"]) -> "ContainsCriterion": | |
| 192 | + | def notin(self, arg: Union[list, tuple, set, frozenset, "Term"]) -> "ContainsCriterion": | |
| 193 | 193 | return self.isin(arg).negate() | |
| 194 | 194 | ||
| 195 | 195 | def bin_regex(self, pattern: str) -> "BasicCriterion": |
The check that tells the two apart
fail→pass·pypika/tests/test_criterions.py::IsInTests::test__function_isin
Check file pypika/tests/test_criterions.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 it5087884bba6e09bbc79c3c9228caf426d79e890b
Broken version dated2023-09-26
Modulepypika.terms
Units changedTerm
Fingerprint5c69ae11b34f138b
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-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
- 2020-12-09Fix groupby_alias specified multiple times in kwargs when subqueries are used