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

isless for DataFrameRow #2287

Closed
bkamins opened this issue Jun 14, 2020 · 2 comments · Fixed by #2292
Closed

isless for DataFrameRow #2287

bkamins opened this issue Jun 14, 2020 · 2 comments · Fixed by #2292
Labels
breaking The proposed change is breaking. decision
Milestone

Comments

@bkamins
Copy link
Member

bkamins commented Jun 14, 2020

isless for DataFrameRow ignores column names, but == checks them.

For NamedTuple isless is undefined so there is no inconsistency there. But we have it for DataFrameRow.

We have two options I think:

  1. disallow isless for DataFrameRow (I think this is the way to go)
  2. change == to ignore column names
@bkamins bkamins added breaking The proposed change is breaking. decision labels Jun 14, 2020
@bkamins bkamins added this to the 1.0 milestone Jun 14, 2020
@nalimilan
Copy link
Member

isless is defined for named tuples when they have identical names. I guess we could do the same and throw an error when names differ. Is that used in a common pattern?

@bkamins
Copy link
Member Author

bkamins commented Jun 16, 2020

it is not that common, but possible. I was misguided by the error message for NamedTuples:

julia> (a=1,b=2) < (a=3,c=4)
ERROR: MethodError: no method matching isless(::NamedTuple{(:a, :b),Tuple{Int64,Int64}}, ::NamedTuple{(:a, :c),Tuple{Int64,Int64}})

but forgotten that NamedTuple has key names in type signature. I will make a fix as you suggest as it makes most sense!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking The proposed change is breaking. decision
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants