Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[flake8-pyi] Stabilize autofix for redundant-numeric-union (PYI041) #15343

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

MichaReiser
Copy link
Member

@MichaReiser MichaReiser commented Jan 8, 2025

Summary

Stabilizes the autofix introduced in #14273

Test Plan

There are no open issues concerning this fix. There are two open issues related to the rule:

@MichaReiser MichaReiser added the fixes Related to suggested fixes for violations label Jan 8, 2025
Copy link
Contributor

github-actions bot commented Jan 8, 2025

ruff-ecosystem results

Linter (stable)

ℹ️ ecosystem check detected linter changes. (+0 -0 violations, +80 -0 fixes in 3 projects; 52 projects unchanged)

apache/airflow (+0 -0 violations, +62 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --no-fix --output-format concise --no-preview --select ALL

- airflow/decorators/__init__.pyi:118:25: PYI041 Use `float` instead of `int | float`
+ airflow/decorators/__init__.pyi:118:25: PYI041 [*] Use `float` instead of `int | float`
- airflow/decorators/__init__.pyi:246:25: PYI041 Use `float` instead of `int | float`
+ airflow/decorators/__init__.pyi:246:25: PYI041 [*] Use `float` instead of `int | float`
- airflow/exceptions.py:419:18: PYI041 Use `float` instead of `int | float`
+ airflow/exceptions.py:419:18: PYI041 [*] Use `float` instead of `int | float`
- airflow/jobs/job.py:296:39: PYI041 Use `float` instead of `int | float`
+ airflow/jobs/job.py:296:39: 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:103:16: PYI041 Use `float` instead of `int | float`
+ airflow/metrics/datadog_logger.py:103:16: PYI041 [*] Use `float` instead of `int | float`
- airflow/metrics/otel_logger.py:238:16: PYI041 Use `float` instead of `int | float`
+ airflow/metrics/otel_logger.py:238:16: 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/models/baseoperator.py:955:18: PYI041 Use `float` instead of `int | float`
+ airflow/models/baseoperator.py:955:18: 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`
- performance/src/performance_dags/performance_dag/performance_dag_utils.py:175:27: PYI041 Use `float` instead of `int | float`
+ performance/src/performance_dags/performance_dag/performance_dag_utils.py:175:27: PYI041 [*] Use `float` instead of `int | float`
- performance/src/performance_dags/performance_dag/performance_dag_utils.py:337:31: PYI041 Use `float` instead of `int | float`
+ performance/src/performance_dags/performance_dag/performance_dag_utils.py:337:31: PYI041 [*] Use `float` instead of `int | float`
- providers/src/airflow/providers/amazon/aws/hooks/batch_client.py:273:16: PYI041 Use `float` instead of `int | float`
+ providers/src/airflow/providers/amazon/aws/hooks/batch_client.py:273:16: PYI041 [*] Use `float` instead of `int | float`
- providers/src/airflow/providers/amazon/aws/hooks/batch_client.py:302:56: PYI041 Use `float` instead of `int | float`
+ providers/src/airflow/providers/amazon/aws/hooks/batch_client.py:302:56: PYI041 [*] Use `float` instead of `int | float`
- providers/src/airflow/providers/amazon/aws/hooks/batch_client.py:325:57: PYI041 Use `float` instead of `int | float`
+ providers/src/airflow/providers/amazon/aws/hooks/batch_client.py:325:57: PYI041 [*] Use `float` instead of `int | float`
- providers/src/airflow/providers/amazon/aws/hooks/batch_client.py:516:27: PYI041 Use `float` instead of `int | float`
+ providers/src/airflow/providers/amazon/aws/hooks/batch_client.py:516:27: PYI041 [*] Use `float` instead of `int | float`
... 24 additional changes omitted for project

apache/superset (+0 -0 violations, +8 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --no-fix --output-format concise --no-preview --select ALL

- superset/daos/query.py:49:52: PYI041 Use `float` instead of `int | float`
+ superset/daos/query.py:49:52: 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`
+ superset/utils/core.py:349:24: PYI041 [*] Use `float` instead of `int | float`
- superset/utils/decorators.py:163:24: PYI041 Use `float` instead of `int | float`
+ superset/utils/decorators.py:163:24: PYI041 [*] Use `float` instead of `int | float`

python/typeshed (+0 -0 violations, +10 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --no-fix --output-format concise --no-preview --select E,F,FA,I,PYI,RUF,UP,W

- stdlib/random.pyi:45:31: PYI041 Use `float` instead of `int | float`
+ 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/random.pyi:52:27: PYI041 [*] Use `float` instead of `int | float`
- stdlib/statistics.pyi:160:15: PYI041 Use `float` instead of `int | float`
+ stdlib/statistics.pyi:160:15: PYI041 [*] Use `float` instead of `int | float`
- stdlib/turtle.pyi:454:16: PYI041 Use `float` instead of `int | float`
+ stdlib/turtle.pyi:454:16: PYI041 [*] Use `float` instead of `int | float`
- stdlib/turtle.pyi:455:17: PYI041 Use `float` instead of `int | float`
+ stdlib/turtle.pyi:455:17: PYI041 [*] Use `float` instead of `int | float`

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
PYI041 80 0 0 80 0

Linter (preview)

✅ ecosystem check detected no linter changes.

@MichaReiser MichaReiser added this to the v0.9 milestone Jan 8, 2025
@AlexWaygood
Copy link
Member

* [Should `PYI041` consider `bool` to be redundant with `int`? #9810](https://github.com/astral-sh/ruff/issues/9810) asks to extend the rule to include `bool`. This should not block stabilization because it's an extension of the rule

I just closed this as rejected!

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

It's weird that we didn't add a test for the preview-only behaviour in #14273. But this all LGTM!

@MichaReiser
Copy link
Member Author

It's weird that we didn't add a test for the preview-only behaviour in #14273. But this all LGTM!

Agree. I think we did, but then gated the fix behind preview without creating a dedicated preview test.

@MichaReiser MichaReiser merged commit 2c1131c into ruff-0.9 Jan 8, 2025
21 checks passed
@MichaReiser MichaReiser deleted the micha/pyi041-fix branch January 8, 2025 11:08
@MichaReiser MichaReiser mentioned this pull request Jan 8, 2025
2 tasks
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
fixes Related to suggested fixes for violations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants