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

Column unioning when appending data #3382

Open
bkamins opened this issue Oct 1, 2023 · 4 comments
Open

Column unioning when appending data #3382

bkamins opened this issue Oct 1, 2023 · 4 comments
Labels
Milestone

Comments

@bkamins
Copy link
Member

bkamins commented Oct 1, 2023

Use DataFrame(Tables.dictcolumntable(t) when cols=:union in append! of a Tables.jl table. x-ref #3372 (comment)

@bkamins
Copy link
Member Author

bkamins commented Oct 12, 2023

Doing this would be breaking. Instead I decided to propose an improvement of the documentation in #3387

@nalimilan
Copy link
Member

What would it break exactly?

@bkamins
Copy link
Member Author

bkamins commented Oct 14, 2023

Currently we have:

julia> append!(DataFrame(), [(a=1,), (a=2,b=3)], cols=:union)
2×1 DataFrame
 Row │ a
     │ Int64
─────┼───────
   1 │     1
   2 │     2

after the proposed breaking change we would have:

julia> append!(DataFrame(), [(a=1,), (a=2,b=3)], cols=:union)
2×2 DataFrame
 Row │ a      b
     │ Int64  Int64?
─────┼────────────────
   1 │     1  missing
   2 │     2        3

@nalimilan
Copy link
Member

Ah. I really dislike that behavior of Tables.columns. This is why having it take a cols argument would make sense. Disregarding this, I wonder whether we could consider the change in DataFrames as a bugfix...

@bkamins bkamins modified the milestones: 1.7, 1.x Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants