Skip to content

fix: make dispatch chains in numba object backend exhaustive - #736

Open
FanxinSun wants to merge 1 commit into
scikit-hep:mainfrom
FanxinSun:fix/pylint-e0606
Open

fix: make dispatch chains in numba object backend exhaustive#736
FanxinSun wants to merge 1 commit into
scikit-hep:mainfrom
FanxinSun:fix/pylint-e0606

Conversation

@FanxinSun

Copy link
Copy Markdown

Adds terminal else: raise AssertionError branches to the dimension/groupname dispatch chains in vector/backends/_numba_object.py that pylint flags as E0606 (possibly-used-before-assignment).

The chains are exhaustive at runtime — dimensions are always 2, 3, or 4, and isclose already validates matching dimensions with a numba.TypingError upstream — so the new branches are unreachable guards. Bare raise AssertionError matches the module's existing convention for impossible states (top of the module).

Verification

  • pylint --enable=E0606 on the file: 9 warnings → 0 (score 9.70 → 9.93)
  • tests/backends/test_numba_object.py: 45 passed
  • full suite with awkward+numba installed (notebooks excluded): 5252 passed, 65 skipped

Fixes #512

Add terminal `else: raise AssertionError` branches to the
dimension/groupname dispatch chains flagged by pylint E0606
(possibly-used-before-assignment). The chains are exhaustive at
runtime (dimensions are always 2, 3, or 4, and isclose validates
matching dimensions upstream), so the new branches are unreachable
guards, matching the existing bare-AssertionError convention at the
top of the module.

Fixes scikit-hep#512

@Saransh-cpp Saransh-cpp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hi @FanxinSun, thanks for picking this up!

Please see #729 (comment) for my take on AI generated comments / code. I'll be happy to review this PR further if there is minimal to none AI usage (given that it is a good first issue).

Can you comment the errors we were getting on this file (the ones you fixed). That will help me review it better.

@codecov

codecov Bot commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.68%. Comparing base (8cbd655) to head (7c385eb).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/vector/backends/_numba_object.py 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #736      +/-   ##
==========================================
- Coverage   87.72%   87.68%   -0.04%     
==========================================
  Files          96       96              
  Lines       11194    11199       +5     
==========================================
  Hits         9820     9820              
- Misses       1374     1379       +5     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@FanxinSun

Copy link
Copy Markdown
Author

Hi @Saransh-cpp, thanks for the reply & review, and sorry for the overfix: my AI agent commited and pushed without my careful review. Apologies and please decline this thread

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.

Possibly used before assignment pylint warning

2 participants