-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Disable reportUnnecessaryTypeIgnoreComment in python_packages.py
#21525
Merged
maximearmstrong
merged 3 commits into
master
from
maxime/disable-report-unnecessary-type-ignore-comment-buildkite-python-packages
Apr 30, 2024
Merged
Disable reportUnnecessaryTypeIgnoreComment in python_packages.py
#21525
maximearmstrong
merged 3 commits into
master
from
maxime/disable-report-unnecessary-type-ignore-comment-buildkite-python-packages
Apr 30, 2024
+2
−0
Conversation
This file contains 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
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @maximearmstrong and the rest of your teammates on |
python_packages.py
This reverts commit 8d1df11.
jmsanders
approved these changes
Apr 30, 2024
nikomancy
pushed a commit
to nikomancy/dagster
that referenced
this pull request
May 1, 2024
…agster-io#21525) ## Summary & Motivation This PR disables the pyright rule `reportUnnecessaryTypeIgnoreComment` in `dagster_buildkite/python_packages.py`. When not disabled, warnings are reported locally and in buildkite, like [here](https://buildkite.com/dagster/dagster-dagster/builds/81582#018f2ff3-5949-4148-b443-d04ff0b56738) ``` /Users/maximearmstrong/Documents/Repositories/dagster-io/dagster/.buildkite/dagster-buildkite/dagster_buildkite/python_packages.py: 34:55: Unnecessary "# type: ignore" comment 44:59: Unnecessary "# type: ignore" comment 85:55: Unnecessary "# type: ignore" comment ``` but removing the `#type: ignore` comment causes problems when running buildkite, like seen in this [thread](https://dagsterlabs.slack.com/archives/C03EQ628RS7/p1712073658618209). ## How I Tested These Changes local `make pyright` BK
maximearmstrong
added a commit
that referenced
this pull request
May 9, 2024
## Summary & Motivation This PR adds a `#type: ignore` to 2 lines in `scripts/create_dagster_package.py` so that Pyright stops yelling. No changes were made to the script in one year, so this is most likely coming from a new Pyright version. Also, disables the Pyright rule `reportUnnecessaryTypeIgnoreComment` for the same reasons as in #21525 Local error: ``` python scripts/run-pyright.py --all Creating temporary pyright config file at pyrightconfig-alt-1.json Running pyright for environment `alt-1`... pyright --project=pyrightconfig-alt-1.json --outputjson --level=warning --warnings Creating temporary pyright config file at pyrightconfig-master.json Running pyright for environment `master`... pyright --project=pyrightconfig-master.json --outputjson --level=warning --warnings /Users/maximearmstrong/Documents/Repositories/dagster-io/dagster/scripts/create_dagster_package.py: 102:56: Argument of type "TextIOWrapper" cannot be assigned to parameter "fp" of type "str | IO[bytes]" in function "dump" Type "TextIOWrapper" cannot be assigned to type "str | IO[bytes]" "TextIOWrapper" is incompatible with "str" "TextIOWrapper" is incompatible with "IO[bytes]" Type parameter "AnyStr@IO" is invariant, but "str" is not the same as "bytes" (reportArgumentType) 127:15: Argument of type "TextIOWrapper" cannot be assigned to parameter "fp" of type "str | IO[bytes]" in function "dump" Type "TextIOWrapper" cannot be assigned to type "str | IO[bytes]" "TextIOWrapper" is incompatible with "str" "TextIOWrapper" is incompatible with "IO[bytes]" Type parameter "AnyStr@IO" is invariant, but "str" is not the same as "bytes" (reportArgumentType) pyright 1.1.356 Finished in 49.03 seconds Analyzed 3440 files Found 2 errors Found 0 warnings make: *** [pyright] Error 1 ``` [BK error](https://buildkite.com/dagster/dagster-dagster/builds/82305#018f4f19-b9a3-4d04-9525-40678bb5ede0) ## How I Tested These Changes ``` make rebuild_pyright_pins make pyright ``` BK
danielgafni
pushed a commit
to danielgafni/dagster
that referenced
this pull request
Jun 18, 2024
## Summary & Motivation This PR adds a `#type: ignore` to 2 lines in `scripts/create_dagster_package.py` so that Pyright stops yelling. No changes were made to the script in one year, so this is most likely coming from a new Pyright version. Also, disables the Pyright rule `reportUnnecessaryTypeIgnoreComment` for the same reasons as in dagster-io#21525 Local error: ``` python scripts/run-pyright.py --all Creating temporary pyright config file at pyrightconfig-alt-1.json Running pyright for environment `alt-1`... pyright --project=pyrightconfig-alt-1.json --outputjson --level=warning --warnings Creating temporary pyright config file at pyrightconfig-master.json Running pyright for environment `master`... pyright --project=pyrightconfig-master.json --outputjson --level=warning --warnings /Users/maximearmstrong/Documents/Repositories/dagster-io/dagster/scripts/create_dagster_package.py: 102:56: Argument of type "TextIOWrapper" cannot be assigned to parameter "fp" of type "str | IO[bytes]" in function "dump" Type "TextIOWrapper" cannot be assigned to type "str | IO[bytes]" "TextIOWrapper" is incompatible with "str" "TextIOWrapper" is incompatible with "IO[bytes]" Type parameter "AnyStr@IO" is invariant, but "str" is not the same as "bytes" (reportArgumentType) 127:15: Argument of type "TextIOWrapper" cannot be assigned to parameter "fp" of type "str | IO[bytes]" in function "dump" Type "TextIOWrapper" cannot be assigned to type "str | IO[bytes]" "TextIOWrapper" is incompatible with "str" "TextIOWrapper" is incompatible with "IO[bytes]" Type parameter "AnyStr@IO" is invariant, but "str" is not the same as "bytes" (reportArgumentType) pyright 1.1.356 Finished in 49.03 seconds Analyzed 3440 files Found 2 errors Found 0 warnings make: *** [pyright] Error 1 ``` [BK error](https://buildkite.com/dagster/dagster-dagster/builds/82305#018f4f19-b9a3-4d04-9525-40678bb5ede0) ## How I Tested These Changes ``` make rebuild_pyright_pins make pyright ``` BK
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.
Summary & Motivation
This PR disables the pyright rule
reportUnnecessaryTypeIgnoreComment
indagster_buildkite/python_packages.py
.When not disabled, warnings are reported locally and in buildkite, like here
but removing the
#type: ignore
comment causes problems when running buildkite, like seen in this thread.How I Tested These Changes
local
make pyright
BK