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

isordered #23

Open
Nosferican opened this issue Oct 7, 2020 · 4 comments · May be fixed by #26
Open

isordered #23

Nosferican opened this issue Oct 7, 2020 · 4 comments · May be fixed by #26

Comments

@Nosferican
Copy link
Contributor

This function is defined in CategoricalArrays.jl.

CategoricalArrays.isordered(x::CategoricalValue) = isordered(x.pool)

However, it is quite generic and would be beneficial to have it defined in DataAPI.jl as something like

DataAPI.isordered(::Any) = false
DataAPI.isordered(obj::AbstractVector) = issorted(obj)

Thoughts?

@bkamins
Copy link
Member

bkamins commented Oct 7, 2020

Indeed it would be good to add it and it was discussed. Note that isordered is not the same as issorted.

This is related to JuliaLang/julia#37239 and Ordered trait

@quinnj
Copy link
Member

quinnj commented Oct 7, 2020

Yes, I'm in favor of this; in Arrow.jl, a dict-encoded column can define whether it's isOrdered as well, so it could leverage this as well.

@bkamins
Copy link
Member

bkamins commented Oct 21, 2020

This should be added also for DataFrames.jl

@nalimilan
Copy link
Member

@Nosferican Could you develop the use case do you have in mind? This is important to decide how to define the trait IMO. See #26.

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 a pull request may close this issue.

4 participants