-
Notifications
You must be signed in to change notification settings - Fork 368
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
Update tests to Tables.jl v1.2 #2530
Conversation
@test select(df, [] => ByRow(() -> [1, "1"]) => AsTable) == DataFrame() | ||
@test_throws ArgumentError select(df, [] => ByRow(() -> [1, "1"]) => [:p, :q]) | ||
@test isequal_coltyped(select(df, [] => ByRow(() -> (1, "1")) => AsTable), | ||
DataFrame(Column1=Int[], Column2=String[])) | ||
@test isequal_coltyped(select(df, [] => ByRow(() -> (1, "1")) => [:p, :q]), | ||
DataFrame(p=Int[], q=String[])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain why (1, "1")
is treated differently from [1, "1"]
now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because in Tables.jl 1.2 tuples have a schema (they have a fixed number of elements), while vectors do not have it (as they can have varying number of elements).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tuple
s now behave like NamedTuple
s but with auto-generated column names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmmm, I don't quite follow what's going on here; how are (1, "1")
and [1, "1"]
being treated here? as an entire table? or as a single row? What (should have) changed in Tables.jl 1.2 is only the "empty" table case, where we will preserve the input schema if possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this is exactly what is tested here - if you look above these lines you will see that we are testing source data frames with 0
rows.
Thank you! |
Fixes #2529