Match note error codes to import error codes#16004
Merged
hauntsaninja merged 3 commits intopython:masterfrom Sep 2, 2023
Merged
Match note error codes to import error codes#16004hauntsaninja merged 3 commits intopython:masterfrom
hauntsaninja merged 3 commits intopython:masterfrom
Conversation
This was referenced Aug 31, 2023
This comment has been minimized.
This comment has been minimized.
Member
|
You'll need to update some ignores in mypy itself: |
This comment has been minimized.
This comment has been minimized.
Contributor
|
Diff from mypy_primer, showing the effect of this PR on open source code: poetry (https://github.com/python-poetry/poetry)
+ src/poetry/installation/chef.py:16: error: Unused "type: ignore" comment, use narrower [import-not-found] instead of [import] code [unused-ignore]
schema_salad (https://github.com/common-workflow-language/schema_salad)
+ schema_salad/tests/memory-leak-check.py:5: error: Unused "type: ignore" comment, use narrower [import-not-found] instead of [import] code [unused-ignore]
+ schema_salad/tests/memory-leak-check.py:6: error: Unused "type: ignore" comment, use narrower [import-not-found] instead of [import] code [unused-ignore]
mypy (https://github.com/python/mypy)
+ mypy/report.py:28: error: Unused "type: ignore" comment, use narrower [import-untyped] instead of [import] code [unused-ignore]
+ mypy/test/testreports.py:10: error: Unused "type: ignore" comment, use narrower [import-untyped] instead of [import] code [unused-ignore]
+ mypy/test/testreports.py:25: error: Unused "type: ignore" comment, use narrower [import-untyped] instead of [import] code [unused-ignore]
+ mypy/test/testcmdline.py:23: error: Unused "type: ignore" comment, use narrower [import-untyped] instead of [import] code [unused-ignore]
+ mypy/test/testcheck.py:29: error: Unused "type: ignore" comment, use narrower [import-untyped] instead of [import] code [unused-ignore]
jax (https://github.com/google/jax)
+ jax/_src/pickle_util.py:21: error: Unused "type: ignore" comment, use narrower [import-not-found] instead of [import] code [unused-ignore]
+ jax/experimental/jax2tf/examples/tf_js/quickdraw/quickdraw.py:33: error: Unused "type: ignore" comment, use narrower [import-not-found] instead of [import] code [unused-ignore]
+ jax/experimental/jax2tf/examples/serving/model_server_request.py:18: error: Unused "type: ignore" comment, use narrower [import-not-found] instead of [import] code [unused-ignore]
+ jax/experimental/jax2tf/examples/serving/model_server_request.py:30: error: Unused "type: ignore" comment, use narrower [import-not-found] instead of [import] code [unused-ignore]
+ jax/experimental/jax2tf/examples/serving/model_server_request.py:31: error: Unused "type: ignore" comment, use narrower [import-not-found] instead of [import] code [unused-ignore]
+ jax/experimental/jax2tf/examples/tflite/mnist/mnist.py:25: error: Unused "type: ignore" comment, use narrower [import-not-found] instead of [import] code [unused-ignore]
spark (https://github.com/apache/spark)
+ python/pyspark/profiler.py:41: error: Unused "type: ignore" comment, use narrower [import-not-found] instead of [import] code [unused-ignore]
+ python/pyspark/accumulators.py:30: error: Unused "type: ignore" comment, use narrower [import-not-found] instead of [import] code [unused-ignore]
+ python/pyspark/pandas/sql_processor.py:18: error: Unused "type: ignore" comment, use narrower [import-not-found] instead of [import] code [unused-ignore]
aiohttp (https://github.com/aio-libs/aiohttp)
+ aiohttp/http_writer.py:192: error: Unused "type: ignore" comment, use narrower [import-not-found] instead of [import] code [unused-ignore]
+ aiohttp/http_websocket.py:163: error: Unused "type: ignore" comment, use narrower [import-not-found] instead of [import] code [unused-ignore]
+ aiohttp/http_parser.py:918: error: Unused "type: ignore[import]" comment, use narrower [import-not-found] instead of [import] code [unused-ignore]
- aiohttp/pytest_plugin.py:23:1: note: See https://mypy.rtfd.io/en/stable/_refs.html#code-import for more info
urllib3 (https://github.com/urllib3/urllib3)
+ src/urllib3/util/request.py:24: error: Unused "type: ignore" comment, use narrower [import-not-found] instead of [import] code [unused-ignore]
+ src/urllib3/util/request.py:26: error: Unused "type: ignore" comment, use narrower [import-not-found] instead of [import] code [unused-ignore]
+ src/urllib3/util/request.py:32: error: Unused "type: ignore" comment, use narrower [import-not-found] instead of [import] code [unused-ignore]
+ src/urllib3/response.py:19: error: Unused "type: ignore" comment, use narrower [import-not-found] instead of [import] code [unused-ignore]
+ src/urllib3/response.py:21: error: Unused "type: ignore" comment, use narrower [import-not-found] instead of [import] code [unused-ignore]
+ src/urllib3/response.py:26: error: Unused "type: ignore" comment, use narrower [import-not-found] instead of [import] code [unused-ignore]
+ src/urllib3/contrib/socks.py:44: error: Unused "type: ignore" comment, use narrower [import-not-found] instead of [import] code [unused-ignore]
+ src/urllib3/contrib/pyopenssl.py:43: error: Unused "type: ignore" comment, use narrower [import-untyped] instead of [import] code [unused-ignore]
+ src/urllib3/contrib/pyopenssl.py:73: error: Unused "type: ignore" comment, use narrower [import-untyped] instead of [import] code [unused-ignore]
+ test/__init__.py:21: error: Unused "type: ignore" comment, use narrower [import-not-found] instead of [import] code [unused-ignore]
+ test/__init__.py:23: error: Unused "type: ignore" comment, use narrower [import-not-found] instead of [import] code [unused-ignore]
+ test/__init__.py:28: error: Unused "type: ignore" comment, use narrower [import-not-found] instead of [import] code [unused-ignore]
+ test/contrib/test_socks.py:12: error: Unused "type: ignore" comment, use narrower [import-not-found] instead of [import] code [unused-ignore]
+ test/contrib/test_pyopenssl.py:10: error: Unused "type: ignore" comment, use narrower [import-untyped] instead of [import] code [unused-ignore]
|
Collaborator
Author
|
Note that the subcode logic is that we only the diagnostic about narrower error codes with If we want to reduce cost of this change, some options are: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #16003. Follow up to #14740