Skip to content

[pyupgrade] Add fix safety section to docs (UP008, UP022)#17441

Merged
ntBre merged 1 commit intoastral-sh:mainfrom
Kalmaegi:doc_fix_safety_for_super_call_with_parameters_and_replace_stdout_stderr
Apr 18, 2025
Merged

[pyupgrade] Add fix safety section to docs (UP008, UP022)#17441
ntBre merged 1 commit intoastral-sh:mainfrom
Kalmaegi:doc_fix_safety_for_super_call_with_parameters_and_replace_stdout_stderr

Conversation

@Kalmaegi
Copy link
Contributor

@Kalmaegi Kalmaegi commented Apr 17, 2025

Summary

add fix safety section to replace_stdout_stderr and super_call_with_parameters, for #15584
I checked the behavior and found that these two files could only potentially delete the appended comments, so I submitted them as a PR.

@Kalmaegi Kalmaegi changed the title add fix safety section to docs add fix safety section to repeated_keys docs Apr 17, 2025
@Kalmaegi Kalmaegi changed the title add fix safety section to repeated_keys docs add fix safety section to docs Apr 17, 2025
@ntBre ntBre self-assigned this Apr 18, 2025
@ntBre ntBre added the documentation Improvements or additions to documentation label Apr 18, 2025
Copy link
Contributor

@ntBre ntBre left a comment

Choose a reason for hiding this comment

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

Thanks! I think these are the only reasons these are unsafe, and I tested them in the playground to show that they both definitely delete comments.

@github-actions
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

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

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

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

- providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/executors/kubernetes_executor_utils.py:141:17: PERF403 Use `dict.update` instead of a for-loop
+ providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/executors/kubernetes_executor_utils.py:141:17: PERF403 Use a dictionary comprehension instead of a for-loop
- providers/exasol/src/airflow/providers/exasol/hooks/exasol.py:70:17: PERF403 Use `dict.update` instead of a for-loop
+ providers/exasol/src/airflow/providers/exasol/hooks/exasol.py:70:17: PERF403 Use a dictionary comprehension instead of a for-loop
- providers/mysql/src/airflow/providers/mysql/hooks/mysql.py:191:17: PERF403 Use `dict.update` instead of a for-loop
+ providers/mysql/src/airflow/providers/mysql/hooks/mysql.py:191:17: PERF403 Use a dictionary comprehension instead of a for-loop
- providers/postgres/src/airflow/providers/postgres/hooks/postgres.py:171:17: PERF403 Use `dict.update` instead of a for-loop
+ providers/postgres/src/airflow/providers/postgres/hooks/postgres.py:171:17: PERF403 Use a dictionary comprehension instead of a for-loop

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

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

- superset/migrations/versions/2021-04-12_12-38_fc3a3a8ff221_migrate_filter_sets_to_new_format.py:122:21: PERF403 Use `dict.update` instead of a for-loop
+ superset/migrations/versions/2021-04-12_12-38_fc3a3a8ff221_migrate_filter_sets_to_new_format.py:122:21: PERF403 Use a dictionary comprehension instead of a for-loop
- superset/migrations/versions/2022-04-01_14-38_a9422eeaae74_new_dataset_models_take_2.py:795:21: PERF403 Use `dict.update` instead of a for-loop
+ superset/migrations/versions/2022-04-01_14-38_a9422eeaae74_new_dataset_models_take_2.py:795:21: PERF403 Use a dictionary comprehension instead of a for-loop

pandas-dev/pandas (+2 -0 violations, +0 -0 fixes)

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

+ pandas/tests/arrays/sparse/test_accessor.py:247:30: RUF043 Pattern passed to `match=` contains metacharacters but is neither escaped nor raw
+ pandas/tests/arrays/sparse/test_accessor.py:96:50: RUF043 Pattern passed to `match=` contains metacharacters but is neither escaped nor raw

Changes by rule (2 rules affected)

code total + violation - violation + fix - fix
PERF403 12 6 6 0 0
RUF043 2 2 0 0 0

@ntBre ntBre changed the title add fix safety section to docs [pyupgrade] Add fix safety section to docs (UP008, UP022) Apr 18, 2025
@ntBre ntBre merged commit c550b4d into astral-sh:main Apr 18, 2025
22 checks passed
@ntBre ntBre mentioned this pull request Apr 18, 2025
71 tasks
@ML719
Copy link

ML719 commented May 27, 2025

Chosing to myself for my boundary,no third party API , only me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants