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

Fix error with ByRow on import #366

Merged
merged 2 commits into from Nov 7, 2023
Merged

Fix error with ByRow on import #366

merged 2 commits into from Nov 7, 2023

Conversation

pdeffebach
Copy link
Collaborator

fixes #365

@pdeffebach
Copy link
Collaborator Author

pdeffebach commented Oct 31, 2023

Requesting a quick review. I went and added $ in front of all ByRow and AsTable calls. I also special-cased AsTable so that AsTable on the right-hand-side, such as a row-sum, works even if DataFramesMeta is only imported.

@bkamins

julia> import DataFramesMeta

julia> import DataFrames

julia> df = DataFrames.DataFrame(x1 = 1, x2 = 2, x3 = 3);

julia> DataFramesMeta.@rtransform df :z = sum(AsTable([:x1, :x2, :x3]))
1×4 DataFrame
 Row │ x1     x2     x3     z     
     │ Int64  Int64  Int64  Int64 
─────┼────────────────────────────
   1 │     1      2      3      6

I figures this is okay since we "own" the expression we are operating on. But long term, it might be nice to make this something DataFramesMeta.jl owns more concretely.

Copy link
Member

@bkamins bkamins left a comment

Choose a reason for hiding this comment

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

looks OK

@pdeffebach
Copy link
Collaborator Author

Failures on nightly are unrelated. We should merge.

@pdeffebach pdeffebach merged commit 1fd3c1a into master Nov 7, 2023
13 of 19 checks passed
@pdeffebach pdeffebach deleted the fix_ByRow branch November 7, 2023 17:04
@pdeffebach pdeffebach restored the fix_ByRow branch November 7, 2023 17:04
pdeffebach added a commit that referenced this pull request Nov 7, 2023
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.

ByRow not defined when importing DataFramesMeta
2 participants