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

Allow double-integer64 joins when double is in (integer32 , integer64] range #6626

Merged
merged 18 commits into from
Dec 6, 2024

Conversation

MichaelChirico
Copy link
Member

@MichaelChirico MichaelChirico commented Nov 26, 2024

Closes #4167.

Probably has some conflict with #6602 -- that one is the priority since it's a CRAN blocker.

I decided to totally ditch isReallyReal() -- it's only ever used in if() statements, so the feature to return the first true-real index is not useful. That leads to the IMO much more readable isRealReallyInt{32,64} approach here.

Copy link

github-actions bot commented Nov 26, 2024

Comparison Plot

Generated via commit 952de9e

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

Task Duration
R setup and installing dependencies 4 minutes and 39 seconds
Installing different package versions 7 minutes and 32 seconds
Running and plotting the test cases 2 minutes and 15 seconds

Copy link

codecov bot commented Nov 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.61%. Comparing base (a36caac) to head (952de9e).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6626   +/-   ##
=======================================
  Coverage   98.61%   98.61%           
=======================================
  Files          79       79           
  Lines       14533    14543   +10     
=======================================
+ Hits        14332    14342   +10     
  Misses        201      201           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

src/utils.c Outdated
static R_xlen_t firstNonInt(SEXP x) {
// used to error if not passed type double but this needed extra is.double() calls in calling R code
// which needed a repeat of the argument. Hence simpler and more robust to return false when not type double.
bool isRealReallyInt32(SEXP x) {
Copy link
Member

@ben-schwen ben-schwen Nov 30, 2024

Choose a reason for hiding this comment

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

maybe isRealAsInt32 and isRealAsInt64 or RealIsInt32 and RealIsInt64?

Copy link
Member Author

Choose a reason for hiding this comment

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

that sounds like the function does coercion to me.

Maybe isDoubleAndInt32? To convey it's in the intersection of the two storage types?

If not that, let's earmark this for discussion in a follow-up issue, since I just adapted the existing naming isRealReallyInt() to be more specific in this PR.

Copy link
Member

@ben-schwen ben-schwen Dec 2, 2024

Choose a reason for hiding this comment

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

isDoubleAndInt32 would work for me, maybe even isRealAndInt32 to convey the difference between R data types and underlying C data types.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm I'm rethinking. That naming implies a symmetry, e.g. suggesting it could accept integer inputs also.

WDYT about isInt32AsReal? realFitsInInt32/fitsInInt32? That highlights we are only interested in whether something currently stored as double could be stored as int instead.

(for the int (32) case, the symmetry part is kinda trivial, because int is a strict subset of double, but the symmetry does not apply to the int64_t case, hence why I'm hesitating)

@ben-schwen
Copy link
Member

LGTM, besides that I find the current naming of isRealReally not ideal

@jangorecki jangorecki removed their request for review November 30, 2024 21:33
@MichaelChirico MichaelChirico added this to the 1.17.0 milestone Dec 3, 2024
@MichaelChirico
Copy link
Member Author

I'll go ahead and merge since the routine name is just a minor detail. We can easily file a follow-up PR to fine-tune.

@MichaelChirico MichaelChirico merged commit 96e89fa into master Dec 6, 2024
11 checks passed
@MichaelChirico MichaelChirico deleted the isreallyi64 branch December 6, 2024 16:08
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.

bmerge errors on integer64 to double join
2 participants