Skip to content

Conversation

@rafaqz
Copy link
Owner

@rafaqz rafaqz commented Nov 5, 2024

No description provided.

@rafaqz rafaqz changed the title Unordered after vec int Breaking: error on unordered indices Nov 5, 2024
@rafaqz rafaqz changed the title Breaking: error on unordered indices Breaking: error on unordered or reverse indices Nov 5, 2024
rebuild(l; data=Base.$f(parent(l), i))
@propagate_inbounds function Base.$f(l::Union{Sampled,Categorical}, i::AbstractVector{Int})
if isordered(l)
issorted(i) || throw(ArgumentError("For `ForwardOrdered` or `ReverseOrdered` lookups, indices of `AbstractVector{Int}` must be in ascending order"))
Copy link
Collaborator

@asinghvi17 asinghvi17 Jul 28, 2025

Choose a reason for hiding this comment

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

why? Can't we just return Unordered?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Yes, but it makes other uses type unstable and slow if we do that.

@tiemvanderdeure tiemvanderdeure mentioned this pull request Oct 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants