Whole file

kayak/pypika

The author described this change as Fix orderby replace table function. It counts as a record because the check below fails on the code as it stood at c6681d7f2 and passes on f1fc31960, with nothing else changed between the two runs.

Fix saved2019-08-16
Sharing licenceApache-2.0 · LICENSE.txt
Change size+2 1

What the code was meant to do, written into the code itself as a save note

Fix orderby replace table function

The change

520520 self._prewheres = self._prewheres.replace_table(current_table, new_table) if self._prewheres else None
521521 self._groupbys = [groupby.replace_table(current_table, new_table) for groupby in self._groupbys]
522522 self._havings = self._havings.replace_table(current_table, new_table) if self._havings else None
523- self._orderbys = [orderby.replace_table(current_table, new_table) for orderby in self._orderbys]
523+ self._orderbys = [(orderby[0].replace_table(current_table, new_table), orderby[1])
524+ for orderby in self._orderbys]
524525 self._joins = [join.replace_table(current_table, new_table) for join in self._joins]
525526
526527 if current_table in self._select_star_tables:

The check that tells the two apart

failpass·pypika/tests/test_query.py::QueryTablesTests::test_replace_orderby_table

Check file pypika/tests/test_query.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 itc6681d7f2b29c45307af0beb0d19a3d46ea6ae0a
Broken version dated2019-08-15
Modulepypika.queries
Units changedQueryBuilder
Fingerprintc08e96a40c89e812
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