Skip to content

Closes #4235: searchsorted to work with uint type - #4440

Merged
ajpotts merged 1 commit into
Bears-R-Us:masterfrom
1RyanK:4235-searchsorted_to_work_with_uint_type
May 23, 2025
Merged

ajpotts merged 1 commit into
Bears-R-Us:masterfrom
1RyanK:4235-searchsorted_to_work_with_uint_type

Conversation

@1RyanK

@1RyanK 1RyanK commented May 22, 2025

Copy link
Copy Markdown
Contributor

I think searchsorted should work with uint types now. The problem was that somehow, v = ak.array(v, dtype) + shift would turn v into an array of float64 if v was originally uint64 and shift was 0. I changed it to be v = ak.array(ak.array(v, dtype) + shift, dtype) (and similarly where we do the same thing to a) and now tests pass. This should probably be fixed in binopvs or wherever it is as well, I imagine this is probably not intended behavior.

I also added a check that the data types match in searchsorted.

Closes #4235: searchsorted to work with uint type

@1RyanK
1RyanK marked this pull request as ready for review May 22, 2025 12:47
@1RyanK
1RyanK force-pushed the 4235-searchsorted_to_work_with_uint_type branch from 31b2f96 to 10ed544 Compare May 22, 2025 13:10

@drculhane drculhane left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good.

@jaketrookman jaketrookman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good

@ajpotts
ajpotts added this pull request to the merge queue May 23, 2025
Merged via the queue into Bears-R-Us:master with commit 6135ac9 May 23, 2025
@1RyanK
1RyanK deleted the 4235-searchsorted_to_work_with_uint_type branch June 3, 2025 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

searchsorted to work with uint type

4 participants