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

correctly use dotview instead of maybeview in broadcasting contexts #1960

Merged
merged 8 commits into from
Sep 19, 2019

Conversation

bkamins
Copy link
Member

@bkamins bkamins commented Sep 18, 2019

Improve warning message for df[col] in broadcasted assignment.

@bkamins bkamins changed the title deprecate maybeview of df[col] deprecate maybeview of df[col] and add broadcastable to LazyNewColDataFrame Sep 18, 2019
Copy link
Member

@nalimilan nalimilan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea whether that's appropriate, I let you judge.

(Apparently one can't remove empty lines at end of files using GitHub...)

@bkamins
Copy link
Member Author

bkamins commented Sep 18, 2019

I judge it is appropriate, as it works and I understand why 😄 (so this is not a hacky patch).

However, I will wait a few days as maybe @mbauman might have some comments here.

@bkamins
Copy link
Member Author

bkamins commented Sep 19, 2019

Having slept over this PR:
my previous solution was not good and actually what was required and sufficient was to redefine maybeview to dotview.

What is going on:

  • maybeview is not reserved for broadcasting purposes only; it is a general mechanism to make a view (or leave things as is); so as @oxinabox indicated - we had a bad design in DataFrames.jl
  • fortunately dotview is used for broadcasting assignment only (these are small details that make design of broadcasting in Base awesome)

This change fixes #1959 in broadcasting contexts but also fixes usage of views in non-broadcasting contexts, like @views typeof(df[!, :]) which were broken (in general I did not realize that with 0.19 we have fixed this kind of problems in general and only ! bug was left - I think this was not caught earlier, because people did not use data frames much in chaining operations when working with views).

@bkamins bkamins changed the title deprecate maybeview of df[col] and add broadcastable to LazyNewColDataFrame correctly use dotview instead of maybeview in broadcasting contexts Sep 19, 2019
@bkamins bkamins merged commit d0dbe26 into JuliaData:master Sep 19, 2019
@bkamins bkamins deleted the maybeview_fix branch September 19, 2019 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants