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

Removing the export of masks for . and j #6198

Merged
merged 9 commits into from
Jun 23, 2024
Merged

Removing the export of masks for . and j #6198

merged 9 commits into from
Jun 23, 2024

Conversation

Nj221102
Copy link
Contributor

@Nj221102 Nj221102 commented Jun 22, 2024

Description

Reverting export of . and J due to them causing revdep issues.

Related issue
#6197

@Nj221102 Nj221102 requested a review from MichaelChirico as a code owner June 22, 2024 09:58
@Nj221102 Nj221102 requested review from tdhock, MichaelChirico and Anirban166 and removed request for MichaelChirico June 22, 2024 09:59
Copy link

github-actions bot commented Jun 22, 2024

Comparison Plot

Generated via commit 675865c

Download link for the artifact containing the test results: ↓ atime-results.zip

Time taken to finish the standard R installation steps: 11 minutes and 49 seconds

Time taken to run atime::atime_pkg on the tests: 3 minutes and 17 seconds

Copy link
Member

@MichaelChirico MichaelChirico left a comment

Choose a reason for hiding this comment

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

please also add a TODO about reverting this later as a reminder in the codebase, and write something in the NEWS about the intention to later export . and J

R/data.table.R Show resolved Hide resolved
@Nj221102 Nj221102 requested a review from MichaelChirico June 22, 2024 23:40
Co-authored-by: Michael Chirico <[email protected]>
NEWS.md Outdated Show resolved Hide resolved
R/data.table.R Outdated Show resolved Hide resolved
@@ -2186,7 +2186,7 @@ if (ncol(DT)==2L) setnames(DT,c("A","B")) # else don't stop under torture with s
test(714, DT[,z:=6:10], data.table(A=1:5,B=5,z=6:10))

# Test J alias is now removed outside DT[...] from v1.8.7 (to resolve rJava::J conflict)
test(715, J(a=1:3,b=4), error="J() called outside of [.data.table. J() is only intended for use in i.")
test(715, J(a=1:3,b=4), error=base_messages$missing_function("J"))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
test(715, J(a=1:3,b=4), error=base_messages$missing_function("J"))
test(715, J(a=1:3,b=4), error=base_messages$missing_function("J"))
# future:
# test(715, J(a=1:3,b=4), error="J() called outside of [.data.table. J() is only intended for use in i.")

Copy link
Contributor Author

@Nj221102 Nj221102 Jun 23, 2024

Choose a reason for hiding this comment

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

this will cause an error because we aren't exporting J

Test 715 didn't produce the correct error:
Expected: J() called outside of [.data.table. J() is only intended for use in i.
Observed: could not find function "J"

so i added j to list where internal-only non exposed functions are imported

  haszlib = data.table:::haszlib
  J = data.table:::J 

is this better or just not changing error ?

Copy link
Member

Choose a reason for hiding this comment

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

sorry, I think you misread the suggested edit -- in mine the "new" test is commented out.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry, I think you misread the suggested edit -- in mine the "new" test is commented out.

oh i am sorry , i didn't notice 😓

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done, plz check it out

Copy link
Member

Choose a reason for hiding this comment

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

I don't know how this passed, but test 715 is now failing locally on my system and I think it should have failed in our CI too.

Since we leave the J function in line 2773 the behavior should already be the future behavior?

Copy link
Contributor Author

@Nj221102 Nj221102 Jun 24, 2024

Choose a reason for hiding this comment

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

@ben-schwen I don't know what's happening but current master branch doesn't seem to be failing test 715 in my local system,

All 11202 tests (last 2264.8) in tests/tests.Rraw completed ok in 14.6s elapsed (14.2s cpu)

Since we leave the J function in line 2773 the behavior should already be the future behavior?

sorry i don't understand much, are you saying that J should be behaving as defined in data.table.R ? we aren't exporting J from our Namespace nor we import it where internal-only non exposed functions are imported in tests.Rraw , so AFAIK i don't think tests.Rraw have access to function j hence the error error=base_messages$missing_function("J")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @ben-schwen are you still facing this issue, plz inform me if I can be of help :)

Nj221102 and others added 4 commits June 23, 2024 10:26
@Nj221102 Nj221102 requested a review from MichaelChirico June 23, 2024 05:20
Copy link
Member

@MichaelChirico MichaelChirico left a comment

Choose a reason for hiding this comment

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

Thank you!

@MichaelChirico MichaelChirico merged commit 4e6ad97 into master Jun 23, 2024
4 checks passed
@MichaelChirico MichaelChirico deleted the masks branch June 23, 2024 14:23
@MichaelChirico
Copy link
Member

MichaelChirico commented Jun 24, 2024 via email

@Nj221102
Copy link
Contributor Author

oh, it's failing under cc(). let's comment it out in our namespace.

On Mon, Jun 24, 2024, 4:05 AM Nitish Jha @.> wrote: @.* commented on this pull request. ------------------------------ In inst/tests/tests.Rraw <#6198 (comment)> : > @@ -2186,7 +2186,7 @@ if (ncol(DT)==2L) setnames(DT,c("A","B")) # else don't stop under torture with s test(714, DT[,z:=6:10], data.table(A=1:5,B=5,z=6:10)) # Test J alias is now removed outside DT[...] from v1.8.7 (to resolve rJava::J conflict) -test(715, J(a=1:3,b=4), error="J() called outside of [.data.table. J() is only intended for use in i.") +test(715, J(a=1:3,b=4), error=base_messages$missing_function("J")) Hi @ben-schwen https://github.com/ben-schwen are you still facing this issue, plz inform me if I can be of help :) — Reply to this email directly, view it on GitHub <#6198 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2BA5ITDEMISHT3QGNKNBDZI74O5AVCNFSM6AAAAABJXJZHJGVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDCMZVGQ3DGNZZGQ . You are receiving this because you modified the open/close state.Message ID: @.***>

Isn't export of j already commented out in Namespace.

export(.SD,.N,.I,.GRP,.NGRP,.BY,.EACHI, measure, patterns)
# TODO(#6197): Export these.
# export(., J)

Am i missing something here?

@MichaelChirico
Copy link
Member

MichaelChirico commented Jun 24, 2024 via email

@MichaelChirico
Copy link
Member

also to clarify, I mean to comment out the definition in the .R file (which builds the package namespace), not the NAMESPACE file, which defines package exports (and is already commented out as you said)

@Nj221102
Copy link
Contributor Author

also to clarify, I mean to comment out the definition in the .R file (which builds the package namespace), not the NAMESPACE file, which defines package exports (and is already commented out as you said)

Thanks for explanation :)

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