-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[flake8-pyi
] Apply redundant-numeric-union
to more type expressions (PYI041
)
#14332
Draft
sbrugman
wants to merge
6
commits into
astral-sh:main
Choose a base branch
from
sbrugman:pyi041-redundant-numeric-union-false-negatives
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[flake8-pyi
] Apply redundant-numeric-union
to more type expressions (PYI041
)
#14332
sbrugman
wants to merge
6
commits into
astral-sh:main
from
sbrugman:pyi041-redundant-numeric-union-false-negatives
+499
−71
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
…c_union.rs Co-authored-by: Micha Reiser <[email protected]>
|
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
PYI041 | 99 | 99 | 0 | 0 | 0 |
Linter (preview)
ℹ️ ecosystem check detected linter changes. (+63 -5 violations, +66 -0 fixes in 10 projects; 44 projects unchanged)
PlasmaPy/PlasmaPy (+4 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ src/plasmapy/analysis/swept_langmuir/floating_potential.py:221:37: PYI041 [*] Use `float` instead of `int | float` + src/plasmapy/formulary/densities.py:159:32: PYI041 [*] Use `float` instead of `int | float` + tests/plasma/test_grids.py:261:32: PYI041 [*] Use `float` instead of `int | float` + tests/plasma/test_grids.py:302:32: PYI041 [*] Use `float` instead of `int | float`
apache/airflow (+30 -0 violations, +58 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL
+ airflow/configuration.py:1165:10: PYI041 [*] Use `float` instead of `int | float` + airflow/configuration.py:67:14: PYI041 [*] Use `float` instead of `int | float` - airflow/decorators/__init__.pyi:117:25: PYI041 Use `float` instead of `int | float` + airflow/decorators/__init__.pyi:117:25: PYI041 [*] Use `float` instead of `int | float` - airflow/decorators/__init__.pyi:256:25: PYI041 Use `float` instead of `int | float` + airflow/decorators/__init__.pyi:256:25: PYI041 [*] Use `float` instead of `int | float` - airflow/jobs/job.py:308:39: PYI041 Use `float` instead of `int | float` + airflow/jobs/job.py:308:39: PYI041 [*] Use `float` instead of `int | float` + airflow/jobs/job.py:63:62: PYI041 [*] Use `float` instead of `int | float` + airflow/jobs/job.py:65:35: PYI041 [*] Use `float` instead of `int | float` - airflow/metrics/base_stats_logger.py:39:15: PYI041 Use `float` instead of `int | float` + airflow/metrics/base_stats_logger.py:39:15: PYI041 [*] Use `float` instead of `int | float` - airflow/metrics/base_stats_logger.py:50:15: PYI041 Use `float` instead of `int | float` + airflow/metrics/base_stats_logger.py:50:15: PYI041 [*] Use `float` instead of `int | float` - airflow/metrics/base_stats_logger.py:61:15: PYI041 Use `float` instead of `int | float` + airflow/metrics/base_stats_logger.py:61:15: PYI041 [*] Use `float` instead of `int | float` - airflow/metrics/datadog_logger.py:113:16: PYI041 Use `float` instead of `int | float` + airflow/metrics/datadog_logger.py:113:16: PYI041 [*] Use `float` instead of `int | float` - airflow/metrics/otel_logger.py:246:16: PYI041 Use `float` instead of `int | float` + airflow/metrics/otel_logger.py:246:16: PYI041 [*] Use `float` instead of `int | float` + airflow/metrics/otel_logger.py:53:15: PYI041 [*] Use `float` instead of `int | float` + airflow/metrics/protocols.py:29:13: PYI041 [*] Use `float` instead of `int | float` - airflow/metrics/statsd_logger.py:117:16: PYI041 Use `float` instead of `int | float` + airflow/metrics/statsd_logger.py:117:16: PYI041 [*] Use `float` instead of `int | float` + airflow/policies.py:109:54: PYI041 [*] Use `float` instead of `int | float` + airflow/serialization/helpers.py:28:65: PYI041 [*] Use `float` instead of `int | float` + airflow/serialization/serde.py:58:5: PYI041 [*] Use `float` instead of `int | float` + airflow/utils/log/colored_log.py:60:33: PYI041 [*] Use `float` instead of `int | float` - airflow/utils/timezone.py:240:26: PYI041 Use `float` instead of `int | float` + airflow/utils/timezone.py:240:26: PYI041 [*] Use `float` instead of `int | float` - airflow/utils/timezone.py:305:16: PYI041 Use `float` instead of `int | float` + airflow/utils/timezone.py:305:16: PYI041 [*] Use `float` instead of `int | float` ... 56 additional changes omitted for project
apache/superset (+11 -0 violations, +8 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL
+ superset/connectors/sqla/models.py:1673:10: PYI041 [*] Use `float` instead of `int | float` - superset/daos/query.py:68:52: PYI041 Use `float` instead of `int | float` + superset/daos/query.py:68:52: PYI041 [*] Use `float` instead of `int | float` + superset/db_engine_specs/base.py:875:10: PYI041 [*] Use `float` instead of `int | float` + superset/distributed_lock/utils.py:31:15: PYI041 [*] Use `float` instead of `int | float` + superset/models/helpers.py:900:10: PYI041 [*] Use `float` instead of `int | float` + superset/superset_typing.py:105:15: PYI041 [*] Use `float` instead of `int | float` - superset/utils/cache.py:150:14: PYI041 Use `float` instead of `int | float` + superset/utils/cache.py:150:14: PYI041 [*] Use `float` instead of `int | float` - superset/utils/core.py:349:24: PYI041 Use `float` instead of `int | float` ... 9 additional changes omitted for project
bokeh/bokeh (+2 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL
+ src/bokeh/core/property/numeric.py:53:24: PYI041 [*] Use `float` instead of `int | float` + tests/support/util/compare.py:50:18: PYI041 [*] Use `float` instead of `int | float`
latchbio/latch (+7 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ src/latch/registry/types.py:37:43: PYI041 [*] Use `float` instead of `int | float` + src/latch/types/json.py:11:24: PYI041 [*] Use `float` instead of `int | float` + src/latch/types/metadata.py:418:28: PYI041 [*] Use `float` instead of `int | float` + src/latch_cli/snakemake/config/utils.py:12:24: PYI041 [*] Use `float` instead of `int | float` + src/latch_cli/snakemake/config/utils.py:196:50: PYI041 [*] Use `float` instead of `int | float` + src/latch_sdk_gql/__init__.py:14:24: PYI041 [*] Use `float` instead of `int | float` + src/latch_sdk_gql/utils.py:37:28: PYI041 [*] Use `float` instead of `int | float`
python/typeshed (+3 -5 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select E,F,FA,I,PYI,RUF,UP,W
+ stdlib/marshal.pyi:12:5: PYI041 Use `complex` instead of `int | float | complex` - stdlib/random.pyi:45:31: PYI041 Use `float` instead of `int | float` - stdlib/random.pyi:52:27: PYI041 Use `float` instead of `int | float` - stdlib/statistics.pyi:160:15: PYI041 Use `float` instead of `int | float` - stdlib/turtle.pyi:443:16: PYI041 Use `float` instead of `int | float` - stdlib/turtle.pyi:444:17: PYI041 Use `float` instead of `int | float` + stdlib/xmlrpc/client.pyi:17:5: PYI041 Use `float` instead of `int | float` + stubs/seaborn/seaborn/utils.pyi:43:5: PYI041 Use `complex` instead of `float | complex`
rotki/rotki (+1 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ rotkehlchen/fval.py:8:27: PYI041 [*] Use `float` instead of `int | float`
zulip/zulip (+4 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL
+ zerver/lib/data_types.py:116:28: PYI041 [*] Use `float` instead of `int | float` + zerver/lib/drafts.py:33:16: PYI041 [*] Use `float` instead of `int | float` + zerver/openapi/markdown_extension.py:257:64: PYI041 [*] Use `float` instead of `int | float` + zilencer/views.py:588:16: PYI041 [*] Use `float` instead of `int | float`
python-trio/trio (+0 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
pytest-dev/pytest (+1 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ src/_pytest/mark/structures.py:472:27: PYI041 [*] Use `float` instead of `int | float`
Changes by rule (1 rules affected)
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
PYI041 | 134 | 63 | 5 | 66 | 0 |
Note for myself, merge #14273 after this PR lands |
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
Fixes false negatives for redundant numeric unions in other places than function arguments, eg. return types, type aliases
Splitting this change of from #14273 (will rebase once that is merged)
Test Plan
cargo test
and reviewed ecosystem results