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

FIX: got rid of type: ignore[unreachable] comments #221 #394

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Saswatsusmoy
Copy link

@Saswatsusmoy Saswatsusmoy commented Oct 17, 2023

Description

Fixes #221
To fix this, we can use a TypeVar to bound the input cls to VectorProtocol. This avoids the inconsistent inheritance issue.
We also don't need the unreachable ignores anymore since the code now typechecks correctly.

Checklist

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't any other open Pull Requests for the required change?
  • Does your submission pass pre-commit? ($ pre-commit run --all-files or $ nox -s lint)
  • Does your submission pass tests? ($ pytest or $ nox -s tests)
  • Does the documentation build with your changes? ($ cd docs; make clean; make html or $ nox -s docs)
  • Does your submission pass the doctests? ($ xdoctest ./src/vector or $ nox -s doctests)

Before Merging

  • Summarize the commit messages into a brief review of the Pull request.

@codecov-commenter
Copy link

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (254e5c9) 83.21% compared to head (f6f3c75) 83.21%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #394   +/-   ##
=======================================
  Coverage   83.21%   83.21%           
=======================================
  Files          96       96           
  Lines       11429    11430    +1     
=======================================
+ Hits         9511     9512    +1     
  Misses       1918     1918           
Files Coverage Δ
src/vector/backends/awkward.py 83.88% <100.00%> (+0.02%) ⬆️

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

Copy link
Collaborator

@Saransh-cpp Saransh-cpp left a comment

Choose a reason for hiding this comment

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

Thanks for taking this up, @Saswatsusmoy! Could you please add warn_unreachable = true under the [tool.mypy] section in pyproject.toml to check if this works?

@Saswatsusmoy
Copy link
Author

Thanks for taking this up, @Saswatsusmoy! Could you please add warn_unreachable = true under the [tool.mypy] section in pyproject.toml to check if this works?

No, it isn't working 16 errors have popped up

src\vector_methods.py:3949: error: Statement is unreachable [unreachable]
src\vector_methods.py:4161: error: Statement is unreachable [unreachable]
src\vector\backends\object.py:430: error: Statement is unreachable [unreachable]
src\vector\backends\object.py:527: error: Statement is unreachable [unreachable]
src\vector\backends\object.py:539: error: Statement is unreachable [unreachable]
src\vector\backends\object.py:551: error: Statement is unreachable [unreachable]
src\vector\backends\numpy.py:86: error: Statement is unreachable [unreachable]
src\vector\backends\numpy.py:88: error: Statement is unreachable [unreachable]
src\vector\backends\numpy.py:91: error: Statement is unreachable [unreachable]
src\vector\backends\numpy.py:105: error: Statement is unreachable [unreachable]
src\vector\backends\numpy.py:108: error: Statement is unreachable [unreachable]
src\vector\backends\numpy.py:817: error: Statement is unreachable [unreachable]
src\vector\backends\numpy.py:928: error: Statement is unreachable [unreachable]
src\vector\backends\numpy.py:940: error: Statement is unreachable [unreachable]
src\vector\backends\numpy.py:952: error: Statement is unreachable [unreachable]
src\vector\backends\awkward.py:584: error: Statement is unreachable [unreachable]
Found 16 errors in 4 files (checked 98 source files)

Can you please help me with this?

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.

Get rid of mypy's # type: ignore[unreachable] comments
3 participants