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.

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

184184 def all_(self) -> "All":
185185 return All(self)
186186
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)):
189189 return ContainsCriterion(self, Tuple(*[self.wrap_constant(value) for value in arg]))
190190 return ContainsCriterion(self, arg)
191191
192- def notin(self, arg: Union[list, tuple, set, "Term"]) -> "ContainsCriterion":
192+ def notin(self, arg: Union[list, tuple, set, frozenset, "Term"]) -> "ContainsCriterion":
193193 return self.isin(arg).negate()
194194
195195 def bin_regex(self, pattern: str) -> "BasicCriterion":

The check that tells the two apart

failpass·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