Whole file
kayak/pypika
The author described this change as “fix field with alias”. It counts as a record because the check below fails on the code as it stood at 8a398afb7 and passes on 95f3d61c4, with nothing else changed between the two runs.
Projectkayak/pypika
Fix saved2020-10-23
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 field with alias
The change
| 314 | 314 | class JSON(Term): | |
| 315 | 315 | table = None | |
| 316 | 316 | ||
| 317 | - | def __init__(self, value: Any, alias: Optional[str] = None) -> None: | |
| 317 | + | def __init__(self, value: Any = None, alias: Optional[str] = None) -> None: | |
| 318 | 318 | super().__init__(alias) | |
| 319 | 319 | self.value = value | |
| 320 | 320 | ||
| ⋯ | |||
| 458 | 458 | def __init__( | |
| 459 | 459 | self, name: str, alias: Optional[str] = None, table: Optional[Union[str, "Selectable"]] = None | |
| 460 | 460 | ) -> None: | |
| 461 | - | super().__init__(alias) | |
| 461 | + | super().__init__(alias=alias) | |
| 462 | 462 | self.name = name | |
| 463 | 463 | self.table = table | |
| 464 | 464 | ||
The check that tells the two apart
fail→pass·pypika/tests/test_terms.py::FieldAliasTests::test_when_alias_specified
Check file pypika/tests/test_terms.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 it8a398afb7d1e29e5191f2d7f801fc4fa59fb7d8a
Broken version dated2020-10-08
Modulepypika.terms
Units changedField, JSON
Fingerprint2e37c0b8f18d3a8f
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