-
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
add support for getproperty broadcasting #2655
Conversation
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.
LGTM; I agree with disallowing for now; better to error for now and we can allow things later.
The problem is that it works under Julia 1.6 although we wanted to disallow it, but we could not because of the limitations of Julia Base. |
todo: tests and docs need an update after @nalimilan comments |
@nalimilan - I have summarized the consequences of this PR in the docstrings. It is super unfortunate we cannot make it consistent. What do you think we should do? |
Unfortunately following the comment by @KristofferC in JuliaLang/julia#39473 (comment) the change will not go into 1.6 LTS. |
I really have a mental problem here. If we introduce this PR now then DataFrames.jl will have a different behavior under different versions of Julia and we will not be able to even give a warning. Maybe a lesser evil is only to add support for creating columns via |
This is exciting! I didn't realize this would get added so soon. I am fine with disallowing for a while. It's a "nice to have" and I'm not sure how many users will be burned by this, at least until we get a new LTS and can be more aggressive with version requirements. |
The problem is that new LTS will be 1.6 most likely. And in 1.6 this feature will not be available, but only in 1.7. Just to clarify the issue: In Julia 1.6 and earlier we have no control over
|
I'd say option 2 is safer, especially since we're likely to release DataFrames 1.0 before Julia 1.7: people won't have had the occasion to test their code against Julia 1.7. But I think we should feel free to remove the deprecation warning and switch to the new, correct behavior relatively quickly, i.e. even before we drop support for Julia 1.6 (anyway the behavior won't change there). Otherwise I'd rather take option 1. |
OK. I will go for option 2 then and add comments in the code what has to be changed. To be clear, what is incorrect in Julia 1.6 are the following things (in general the incorrect things are where
As noted above it is impossible to fix this behavior in Julia 1.6 because the resolution of the operation happens at parse time before DataFrames.jl mechanics is able to intervene and change this behavior. |
Co-authored-by: Milan Bouchet-Valat <nalimilan@club.fr>
@nalimilan - OK to merge? |
Thank you! |
Now we will be able to do:
even if
:a
is not present indf
.The only decision to be made is if we want to allow:
dfv.a .= 1
ifdfv
is aSubDataFrame
. Currently this is allowed, but it is inconsistent withdfv[!, :a] .= 1
so I would disallow it. The problem is that then DataFrames.jl would work differently under Julia 1.7 and prior to 1.7 in this area - thus it is a hard decision to make.