-
Notifications
You must be signed in to change notification settings - Fork 372
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
WIP: make indexing and eachcol return views of data frame columns #1856
Conversation
I already see one slight issue with this PR. Earlier when we written |
Indeed. Though AFAICT that's not a big problem, right? We could add an argument to |
I was thinking over this and I think it is mostly problem for me (as I do internal development). For people having a Now you have raised a |
Regarding what kind of behaviors (so essentially keyword arguments) we want in assuming |
It could make sense to have a keyword argument to |
@nalimilan We have revenge of the |
I think people should just switch to |
@oxinabox It turns out that returning a The consequence is that introducing such a change would have to be synchronized with changes in all packages that use CategoricalArrays.jl and DataFrames.jl to make sure that they do not break (and they probably would as up till now the normal way to check if something is a categorical variable was checking its type against |
So in other words it's not completely clear that the involved work and increased complexity (for us, but also for users) are worth the limited increase in safety. |
Personally, I think we'll run into a decent amount of cases where users will be surprised by this, not unlike the switch in |
I think it is worth it, |
The conclusion from the discussions and the implementation in #1866 is that we will return vectors not their views so I am closing this PR. |
This fixes #1844.
I open this in case there are any design comments. This is still WIP as I have to do two things:
df[:col]
returning the actual stored vector not itsview