Skip to content

Commit

Permalink
fix: regression in Selection.sort_by with resolved_keys
Browse files Browse the repository at this point in the history
  • Loading branch information
gforsyth authored and cpcloud committed Mar 29, 2022
1 parent 24c8b73 commit c7a69cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ibis/backends/tests/test_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,3 +397,8 @@ def test_dropna_table(backend, alltypes, how, subset):
# is type object in Pyspark, and type bool in Pandas. This diff does
# not exist in Java 11.
backend.assert_frame_equal(result, expected, check_dtype=False)


def test_select_sort_sort(alltypes):
query = alltypes[alltypes.year, alltypes.bool_col]
query = query.sort_by(query.year).sort_by(query.bool_col)
2 changes: 1 addition & 1 deletion ibis/expr/operations/relations.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ def sort_by(self, expr, sort_exprs):
self.table,
self.selections,
predicates=self.predicates,
sort_keys=self.sort_keys + resolved_keys,
sort_keys=self.sort_keys + tuple(resolved_keys),
)

return Selection(expr, [], sort_keys=resolved_keys)
Expand Down

0 comments on commit c7a69cd

Please sign in to comment.