Skip to content
This repository has been archived by the owner on May 4, 2019. It is now read-only.

Add missing LineNumberNode to @swappable call (fixes #257) #259

Merged
merged 3 commits into from
May 30, 2017

Conversation

getzdan
Copy link
Contributor

@getzdan getzdan commented May 29, 2017

There has been some change to Julia in the macrocall AST, adding the LineNumberNode.
Unless there is another change to Julia, some packages using :macrocall expression generation will break.

@nalimilan
Copy link
Member

Thanks. Indeed this fixes loading the package, but I wonder whether the test failure may be related: the path between #= and =# is suspicious.

Booleans: Error During Test
  Expression evaluated to non-Boolean
  Expression: any(#= C:\Users\appveyor\.julia\v0.7\DataArrays\test\booleans.jl:15 =# @data([NA, 1, 2]) .== 1) == true
       Value: NA

@getzdan
Copy link
Contributor Author

getzdan commented May 29, 2017

Don't think the test error is related. Actually, it seems to me the test should Fail (but not error), as 1 == NA should be NA. But this discussion is for the other issue.

src/operators.jl Outdated
@@ -138,7 +138,11 @@ macro dataarray_binary_scalar(vectorfunc, scalarfunc, outtype, swappable)
if swappable
# For /, Array/Number is valid but not Number/Array
# All other operators should be swappable
map!(x->Expr(:macrocall, Symbol("@swappable"), LineNumberNode(@__LINE__), x, scalarfunc), fns, fns)
if VERSION < v"0.7.0-"
Copy link
Member

Choose a reason for hiding this comment

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

It would be great if you could identify the exact commit which broke this (use contrib/commit-name.sh).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My guess is the exact commit is: 0.7.0-DEV.328 . Specifically, JuliaLang/julia@fcdf437

Copy link
Contributor

@tkelman tkelman May 30, 2017

Choose a reason for hiding this comment

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

You should use the merge commit JuliaLang/julia@9e3318c. Its master parent commit, JuliaLang/julia@8b2cac4, is 0.7.0-DEV.353 but does not have this change.

Copy link
Member

Choose a reason for hiding this comment

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

Damn, everybody gets this wrong at least once. Do you think the script could do this automatically?

Copy link
Contributor

Choose a reason for hiding this comment

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

we could maybe have it do some git operations to try to figure out whether the commit it runs on is a merge (or squash merge) commit or something from a PR branch and give a warning, but I'm not sure what to check for

Copy link
Contributor

Choose a reason for hiding this comment

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

If github would fix "rebase and merge" to include a reference to the PR number, we could switch to that for multi-commit PR's and disable the normal merge commit option. Single-commit PR's should almost always be squash merged since there's no reason not to, so it's only multi-commit PR's where there's a risk of VERSION getting things wrong.

Copy link
Contributor

Choose a reason for hiding this comment

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

did this get fixed?

Copy link
Member

Choose a reason for hiding this comment

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

No, but see #264.

@getzdan
Copy link
Contributor Author

getzdan commented May 29, 2017

You are right .== is acting weird:

julia> (@data [NA, 1, 2]) .== 1
0-dimensional DataArrays.DataArray{Bool,0}:
NA

@nalimilan
Copy link
Member

I guess we can still merge this (after updating the version check) and continue debugging, as it's always easier to debug a package that can be loaded.

@ararslan
Copy link
Member

Thanks for figuring this out!

@ararslan ararslan merged commit 1521237 into JuliaStats:master May 30, 2017
@nalimilan
Copy link
Member

The failure actually comes from a change in Base, see JuliaLang/julia#22019 and JuliaLang/julia#22130.

@getzdan getzdan deleted the pull-request/7d602fa4 branch May 30, 2017 09:40
@nalimilan nalimilan mentioned this pull request Jun 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants