Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(api): remove tuple support in SortKey #9416

Merged
merged 2 commits into from
Jun 21, 2024

Conversation

cpcloud
Copy link
Member

@cpcloud cpcloud commented Jun 21, 2024

Removes a code path to handle tuples in ops.SortKey. This code path is apparently never hit (thanks to @ncclement for noticing this) and so has not worked for a while. Therefore, I decided to not mark this as a breaking change.

Closes #9413.

@cpcloud cpcloud added this to the 9.2 milestone Jun 21, 2024
@cpcloud cpcloud added the refactor Issues or PRs related to refactoring the codebase label Jun 21, 2024
@cpcloud cpcloud force-pushed the remove-tuple-in-sort-keys branch from a596ada to 592986d Compare June 21, 2024 17:13
Copy link
Member

@jcrist jcrist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine by me.

Did we deliberately break support for tuple[Column, bool] as SortKey descriptions? This is indeed broken on main, but I don't remember this being an intentional decision to drop support (and would have thought we'd have an expression-level test for this).

In [1]: import ibis
 
In [2]: t = ibis.table({"x": "string", "y": "string"})

In [3]: t.order_by((t.x, False))  # this used to coerce to a descending sort by x IIRC
Out[3]: 
r0 := UnboundTable: unbound_table_0
  x string
  y string

Sort[r0]
  asc r0.x
  asc False

@cpcloud
Copy link
Member Author

cpcloud commented Jun 21, 2024

I don't think this was intentional. I am also surprised that we had no tests for this.

@jcrist
Copy link
Member

jcrist commented Jun 21, 2024

I'm fine not fixing/readding it. ibis.asc/ibis.desc (or the method versions) are more readable and easier to work with anyway.

@cpcloud cpcloud merged commit 4dff6e2 into ibis-project:main Jun 21, 2024
75 checks passed
@cpcloud cpcloud deleted the remove-tuple-in-sort-keys branch June 21, 2024 18:03
@kszucs
Copy link
Member

kszucs commented Jun 21, 2024

Possibly this change has disabled that code path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Issues or PRs related to refactoring the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(api): sorting by tuple keys doesn't seem to work
4 participants