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

DataFrame(t::Table) converts PooledVector columns #3436

Closed
behinger opened this issue Apr 11, 2024 · 2 comments
Closed

DataFrame(t::Table) converts PooledVector columns #3436

behinger opened this issue Apr 11, 2024 · 2 comments
Labels
Milestone

Comments

@behinger
Copy link

behinger commented Apr 11, 2024

potentially related to #3432

using PooledArrays
using TypedTables
using DataFrames
t = Table(b = PooledArray([2,3,1]),a=PooledArray([1,2,3]))

DataFrame(t).a # returns Vector
DataFrame(columns(t)).a # returns PooledVector

I expected the DataFrame constructor to keep the Vector type intact. Not really sure why the columns helps that much - I dont understand the Tables.jl interface on that level.

Maybe this report helps someone, for me the solution with columns is fine

@bkamins bkamins added this to the 1.7 milestone Apr 11, 2024
@bkamins
Copy link
Member

bkamins commented Apr 11, 2024

The reason is that t to the "outside world" communicates that it is an iterator of rows, so DataFrame constructs a vectors from these rows.

@behinger
Copy link
Author

ah I see, that makes sense. Thanks!!

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