-
Notifications
You must be signed in to change notification settings - Fork 54
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
Avoid type piracy via getproperty #64
Comments
Maybe.....this is also very, very minor piracy. We're not changing any Base behavior and defining a method signature that isn't likely to collide. |
Not very likely, but conflicts are not completely impossible either. |
I think that this issue is more general than just type piracy. We were discussing on slack if it would be possible to implement the Tables.jl interface without relying on Many people were involved in the discussion on slack that I am cc'ing here: @oxinabox, @nalimilan, @bkamins @ararslan. You can check the discussion before slack erases it: https://julialang.slack.com/archives/C6821M4KE/p1578165006066100 Overall, I think there is no strong reason to constrain the interface to |
the proposal is something like define
|
One thing I noticed about d = Dict(:a=>rand(3)) # infers the column types to be Vector{Float64}
d[:b] = rand(Int, 3) # undesirably convert the type from Int to Float64
d[:b] # now contains a Vector{Float64} Is there any remedy to this issue? It seems severe in this context of tables with multiple column types specified a posteriori. |
Let's keep this issue focused on the |
Ok, I've been mulling this over for a few weeks and while I think I'm on board, and even started implementing it, my one concern is that things may become less convenient for users. While it seems simple to say, "just add
This is a non-issue; if you need heterogeneous column types and fully typed columns, use a proper table type, not a Dict. It's just not the right tool for the job. And I don't know of any serious efforts to try and treat Dicts as tables. Not that I'm opposed to adding |
Yes, I admit it wouldn't be as convenient. I guess the question is really: do we want to support |
Fixed in #131 |
This method should be replaced with a function owned by Tables.jl:
Tables.jl/src/utils.jl
Line 26 in 7f9a1f9
The text was updated successfully, but these errors were encountered: