-
Notifications
You must be signed in to change notification settings - Fork 26
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
[c++] Fix fast path for SparseNDArray
nnz
#3229
Conversation
94d358a
to
6eaba1e
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3229 +/- ##
==========================================
+ Coverage 83.86% 83.97% +0.10%
==========================================
Files 51 51
Lines 5505 5505
==========================================
+ Hits 4617 4623 +6
+ Misses 888 882 -6
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand why this change "fixes" the problem, but I'm uncomfortable with the design (in both the original PR and in this fix). It relies on a heuristic (names), and disallows lots of cases where the fast path would work fine (e.g., other non-variable-sized dimensions)
Possible solutions to consider:
- directly test the dimension to determine if it variable-sized. Only then fall back (ie.., don't test name or hard-wire to only int64)
- Or, given that the most common case, simply wrap the nonempty-domain fetch in a try/catch, and call the slow path only when you can't get it.
Either of these seem far less likely to bite us in the future as they are not heuristics based
@bkmartinjr #3231 if you're willing to take this as a follow-on
You're correct
I do want to do that as separate PRs -- this one and the to-be-created tracked on #3231 -- precisely because this PR "gets it right" for the most important cases which are (a) default-indexed dataframes; (b) all ND arrays always (which must have int64 dims). So the follow-on PR will enable us to take the fast path for non-default-indexed dataframes, and that will be nice. |
Issue and/or context: [sc-58277]
Changes:
Notes for Reviewer: