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

Update tests to Tables.jl v1.2 #2530

Merged
merged 4 commits into from
Nov 10, 2020
Merged

Update tests to Tables.jl v1.2 #2530

merged 4 commits into from
Nov 10, 2020

Conversation

bkamins
Copy link
Member

@bkamins bkamins commented Nov 10, 2020

Fixes #2529

@bkamins bkamins mentioned this pull request Nov 10, 2020
20 tasks
@bkamins bkamins added this to the 1.0 milestone Nov 10, 2020
@bkamins bkamins added bug ecosystem Issues in DataFrames.jl ecosystem labels Nov 10, 2020
Comment on lines +1545 to +1550
@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[]))
Copy link
Member

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?

Copy link
Member Author

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).

Copy link
Member Author

Choose a reason for hiding this comment

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

Tuples now behave like NamedTuples but with auto-generated column names.

Copy link
Member

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.

Copy link
Member Author

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.

@bkamins bkamins merged commit 0f089d9 into master Nov 10, 2020
@bkamins bkamins deleted the bkamins-patch-1 branch November 10, 2020 19:09
@bkamins
Copy link
Member Author

bkamins commented Nov 10, 2020

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ecosystem Issues in DataFrames.jl ecosystem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sync tests with Tables 1.2
3 participants