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 aliasing columns on assignment #1052
Conversation
Thanks! Indeed, it's more consistent to always return a newly-allocated vector from |
Looks like this is causing this line to fail on 0.4: df = DataFrame(A = Array(String, 3)) |
Two comments:
|
@andreasnoack I'll separate out the single change in line 414 and keep this open for discussion. |
Actually, I find it weird that We could also deprecate this indexing method, but probably better keep this discussion separate. |
Good point. I think you are right here. It is how we usually do this and it is also likely to be more efficient. |
So what's the decision on setting columns to vectors? Should that copy the data into the existing vector, or replace (and thus alias)? |
I'd vote for copying the data into the existing and failing if not possible. |
Closing, as it seems like the redesign will make a lot of these issues redundant. |
I don't think we have precise plans to fix this in a different way, and DataFrames still exists, so better keep it open. |
This PR does not implement the suggestion of @andreasnoack. I suspect that suggestion can be worded as simply
which is a more minimal change than this PR, albeit possibly disruptive. |
Could you open a PR against DataTables? Disruptive changes are appreciated there. ;-) |
|
We still have |
See #1528. |
A Stack Overflow user has reported behaviour that I thought was strange, with regard to aliasing between columns: http://stackoverflow.com/questions/39320783/julia-dataframe-changing-one-cell-changes-entire-row
This makes
upgrade_vector
copying and also unhoists the broadcasting, to remove aliasing. Of course, the performance of these operations will be much worse.Fixes #1051.