Skip to content

Conversation

@terror
Copy link
Contributor

@terror terror commented Oct 4, 2025

Resolves #20694

This PR updates the zip_without_explicit_strict and map_without_explicit_strict rules so their fixes are always marked unsafe, following Brent's guidance that adding strict=False can silently preserve buggy behaviour when inputs differ. The fix safety docs now spell out that reasoning, the applicability drops to Unsafe, and the snapshots were refreshed so Ruff clearly warns users before applying the edit.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2025

ruff-ecosystem results

Linter (stable)

ℹ️ ecosystem check detected linter changes. (+0 -0 violations, +0 -176 fixes in 1 projects; 54 projects unchanged)

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

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

- airflow-core/tests/unit/api_fastapi/common/test_exceptions.py:83:56: B905 [*] `zip()` without an explicit `strict=` parameter
+ airflow-core/tests/unit/api_fastapi/common/test_exceptions.py:83:56: B905 `zip()` without an explicit `strict=` parameter
- airflow-core/tests/unit/api_fastapi/common/test_exceptions.py:84:41: B905 [*] `zip()` without an explicit `strict=` parameter
+ airflow-core/tests/unit/api_fastapi/common/test_exceptions.py:84:41: B905 `zip()` without an explicit `strict=` parameter
- airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_event_logs.py:325:42: B905 [*] `zip()` without an explicit `strict=` parameter
+ airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_event_logs.py:325:42: B905 `zip()` without an explicit `strict=` parameter
- airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_import_error.py:106:56: B905 [*] `zip()` without an explicit `strict=` parameter
+ airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_import_error.py:106:56: B905 `zip()` without an explicit `strict=` parameter
- airflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_task_instances.py:1582:26: B905 [*] `zip()` without an explicit `strict=` parameter
+ airflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_task_instances.py:1582:26: B905 `zip()` without an explicit `strict=` parameter
- airflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_task_instances.py:1725:26: B905 [*] `zip()` without an explicit `strict=` parameter
+ airflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_task_instances.py:1725:26: B905 `zip()` without an explicit `strict=` parameter
- airflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_task_instances.py:1899:26: B905 [*] `zip()` without an explicit `strict=` parameter
+ airflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_task_instances.py:1899:26: B905 `zip()` without an explicit `strict=` parameter
- airflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_task_instances.py:1932:26: B905 [*] `zip()` without an explicit `strict=` parameter
+ airflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_task_instances.py:1932:26: B905 `zip()` without an explicit `strict=` parameter
- airflow-core/tests/unit/assets/test_evaluation.py:106:79: B905 [*] `zip()` without an explicit `strict=` parameter
+ airflow-core/tests/unit/assets/test_evaluation.py:106:79: B905 `zip()` without an explicit `strict=` parameter
- airflow-core/tests/unit/models/test_dagrun.py:2493:22: B905 [*] `zip()` without an explicit `strict=` parameter
+ airflow-core/tests/unit/models/test_dagrun.py:2493:22: B905 `zip()` without an explicit `strict=` parameter
- airflow-core/tests/unit/timetables/test_events_timetable.py:114:27: B905 [*] `zip()` without an explicit `strict=` parameter
+ airflow-core/tests/unit/timetables/test_events_timetable.py:114:27: B905 `zip()` without an explicit `strict=` parameter
- airflow-core/tests/unit/timetables/test_events_timetable.py:69:10: B905 [*] `zip()` without an explicit `strict=` parameter
+ airflow-core/tests/unit/timetables/test_events_timetable.py:69:10: B905 `zip()` without an explicit `strict=` parameter
- airflow-core/tests/unit/timetables/test_workday_timetable.py:57:10: B905 [*] `zip()` without an explicit `strict=` parameter
+ airflow-core/tests/unit/timetables/test_workday_timetable.py:57:10: B905 `zip()` without an explicit `strict=` parameter
- airflow-ctl/tests/airflow_ctl/ctl/test_cli_config.py:254:42: B905 [*] `zip()` without an explicit `strict=` parameter
+ airflow-ctl/tests/airflow_ctl/ctl/test_cli_config.py:254:42: B905 `zip()` without an explicit `strict=` parameter
- airflow-ctl/tests/airflow_ctl/ctl/test_cli_config.py:263:42: B905 [*] `zip()` without an explicit `strict=` parameter
+ airflow-ctl/tests/airflow_ctl/ctl/test_cli_config.py:263:42: B905 `zip()` without an explicit `strict=` parameter
- airflow-ctl/tests/airflow_ctl/ctl/test_cli_config.py:269:42: B905 [*] `zip()` without an explicit `strict=` parameter
+ airflow-ctl/tests/airflow_ctl/ctl/test_cli_config.py:269:42: B905 `zip()` without an explicit `strict=` parameter
- airflow-ctl/tests/airflow_ctl/ctl/test_cli_config.py:275:42: B905 [*] `zip()` without an explicit `strict=` parameter
+ airflow-ctl/tests/airflow_ctl/ctl/test_cli_config.py:275:42: B905 `zip()` without an explicit `strict=` parameter
- dev/airflow_perf/sql_queries.py:108:21: B905 [*] `zip()` without an explicit `strict=` parameter
+ dev/airflow_perf/sql_queries.py:108:21: B905 `zip()` without an explicit `strict=` parameter
- dev/breeze/src/airflow_breeze/commands/release_management_commands.py:2945:31: B905 [*] `zip()` without an explicit `strict=` parameter
+ dev/breeze/src/airflow_breeze/commands/release_management_commands.py:2945:31: B905 `zip()` without an explicit `strict=` parameter
- dev/breeze/src/airflow_breeze/utils/packages.py:1166:54: B905 [*] `zip()` without an explicit `strict=` parameter
+ dev/breeze/src/airflow_breeze/utils/packages.py:1166:54: B905 `zip()` without an explicit `strict=` parameter
- dev/breeze/tests/test_selective_checks.py:61:32: B905 [*] `zip()` without an explicit `strict=` parameter
+ dev/breeze/tests/test_selective_checks.py:61:32: B905 `zip()` without an explicit `strict=` parameter
- dev/breeze/tests/test_selective_checks.py:64:50: B905 [*] `zip()` without an explicit `strict=` parameter
+ dev/breeze/tests/test_selective_checks.py:64:50: B905 `zip()` without an explicit `strict=` parameter
- dev/stats/get_important_pr_candidates.py:677:36: B905 [*] `zip()` without an explicit `strict=` parameter
+ dev/stats/get_important_pr_candidates.py:677:36: B905 `zip()` without an explicit `strict=` parameter
- dev/validate_version_added_fields_in_config.py:126:35: B905 [*] `zip()` without an explicit `strict=` parameter
+ dev/validate_version_added_fields_in_config.py:126:35: B905 `zip()` without an explicit `strict=` parameter
- devel-common/src/tests_common/test_utils/logs.py:168:48: B905 [*] `zip()` without an explicit `strict=` parameter
+ devel-common/src/tests_common/test_utils/logs.py:168:48: B905 `zip()` without an explicit `strict=` parameter
... 126 additional changes omitted for project

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
B905 176 0 0 0 176

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+0 -0 violations, +0 -176 fixes in 1 projects; 54 projects unchanged)

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

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

- airflow-core/tests/unit/api_fastapi/common/test_exceptions.py:83:56: B905 [*] `zip()` without an explicit `strict=` parameter
+ airflow-core/tests/unit/api_fastapi/common/test_exceptions.py:83:56: B905 `zip()` without an explicit `strict=` parameter
- airflow-core/tests/unit/api_fastapi/common/test_exceptions.py:84:41: B905 [*] `zip()` without an explicit `strict=` parameter
+ airflow-core/tests/unit/api_fastapi/common/test_exceptions.py:84:41: B905 `zip()` without an explicit `strict=` parameter
- airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_event_logs.py:325:42: B905 [*] `zip()` without an explicit `strict=` parameter
+ airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_event_logs.py:325:42: B905 `zip()` without an explicit `strict=` parameter
- airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_import_error.py:106:56: B905 [*] `zip()` without an explicit `strict=` parameter
+ airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_import_error.py:106:56: B905 `zip()` without an explicit `strict=` parameter
- airflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_task_instances.py:1582:26: B905 [*] `zip()` without an explicit `strict=` parameter
+ airflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_task_instances.py:1582:26: B905 `zip()` without an explicit `strict=` parameter
- airflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_task_instances.py:1725:26: B905 [*] `zip()` without an explicit `strict=` parameter
+ airflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_task_instances.py:1725:26: B905 `zip()` without an explicit `strict=` parameter
- airflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_task_instances.py:1899:26: B905 [*] `zip()` without an explicit `strict=` parameter
+ airflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_task_instances.py:1899:26: B905 `zip()` without an explicit `strict=` parameter
- airflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_task_instances.py:1932:26: B905 [*] `zip()` without an explicit `strict=` parameter
+ airflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_task_instances.py:1932:26: B905 `zip()` without an explicit `strict=` parameter
- airflow-core/tests/unit/assets/test_evaluation.py:106:79: B905 [*] `zip()` without an explicit `strict=` parameter
+ airflow-core/tests/unit/assets/test_evaluation.py:106:79: B905 `zip()` without an explicit `strict=` parameter
- airflow-core/tests/unit/models/test_dagrun.py:2493:22: B905 [*] `zip()` without an explicit `strict=` parameter
+ airflow-core/tests/unit/models/test_dagrun.py:2493:22: B905 `zip()` without an explicit `strict=` parameter
- airflow-core/tests/unit/timetables/test_events_timetable.py:114:27: B905 [*] `zip()` without an explicit `strict=` parameter
+ airflow-core/tests/unit/timetables/test_events_timetable.py:114:27: B905 `zip()` without an explicit `strict=` parameter
- airflow-core/tests/unit/timetables/test_events_timetable.py:69:10: B905 [*] `zip()` without an explicit `strict=` parameter
+ airflow-core/tests/unit/timetables/test_events_timetable.py:69:10: B905 `zip()` without an explicit `strict=` parameter
- airflow-core/tests/unit/timetables/test_workday_timetable.py:57:10: B905 [*] `zip()` without an explicit `strict=` parameter
+ airflow-core/tests/unit/timetables/test_workday_timetable.py:57:10: B905 `zip()` without an explicit `strict=` parameter
- airflow-ctl/tests/airflow_ctl/ctl/test_cli_config.py:254:42: B905 [*] `zip()` without an explicit `strict=` parameter
+ airflow-ctl/tests/airflow_ctl/ctl/test_cli_config.py:254:42: B905 `zip()` without an explicit `strict=` parameter
- airflow-ctl/tests/airflow_ctl/ctl/test_cli_config.py:263:42: B905 [*] `zip()` without an explicit `strict=` parameter
+ airflow-ctl/tests/airflow_ctl/ctl/test_cli_config.py:263:42: B905 `zip()` without an explicit `strict=` parameter
- airflow-ctl/tests/airflow_ctl/ctl/test_cli_config.py:269:42: B905 [*] `zip()` without an explicit `strict=` parameter
+ airflow-ctl/tests/airflow_ctl/ctl/test_cli_config.py:269:42: B905 `zip()` without an explicit `strict=` parameter
- airflow-ctl/tests/airflow_ctl/ctl/test_cli_config.py:275:42: B905 [*] `zip()` without an explicit `strict=` parameter
+ airflow-ctl/tests/airflow_ctl/ctl/test_cli_config.py:275:42: B905 `zip()` without an explicit `strict=` parameter
- dev/airflow_perf/sql_queries.py:108:21: B905 [*] `zip()` without an explicit `strict=` parameter
+ dev/airflow_perf/sql_queries.py:108:21: B905 `zip()` without an explicit `strict=` parameter
- dev/breeze/src/airflow_breeze/commands/release_management_commands.py:2945:31: B905 [*] `zip()` without an explicit `strict=` parameter
+ dev/breeze/src/airflow_breeze/commands/release_management_commands.py:2945:31: B905 `zip()` without an explicit `strict=` parameter
- dev/breeze/src/airflow_breeze/utils/packages.py:1166:54: B905 [*] `zip()` without an explicit `strict=` parameter
+ dev/breeze/src/airflow_breeze/utils/packages.py:1166:54: B905 `zip()` without an explicit `strict=` parameter
- dev/breeze/tests/test_selective_checks.py:61:32: B905 [*] `zip()` without an explicit `strict=` parameter
+ dev/breeze/tests/test_selective_checks.py:61:32: B905 `zip()` without an explicit `strict=` parameter
- dev/breeze/tests/test_selective_checks.py:64:50: B905 [*] `zip()` without an explicit `strict=` parameter
+ dev/breeze/tests/test_selective_checks.py:64:50: B905 `zip()` without an explicit `strict=` parameter
- dev/stats/get_important_pr_candidates.py:677:36: B905 [*] `zip()` without an explicit `strict=` parameter
+ dev/stats/get_important_pr_candidates.py:677:36: B905 `zip()` without an explicit `strict=` parameter
- dev/validate_version_added_fields_in_config.py:126:35: B905 [*] `zip()` without an explicit `strict=` parameter
+ dev/validate_version_added_fields_in_config.py:126:35: B905 `zip()` without an explicit `strict=` parameter
- devel-common/src/tests_common/test_utils/logs.py:168:48: B905 [*] `zip()` without an explicit `strict=` parameter
+ devel-common/src/tests_common/test_utils/logs.py:168:48: B905 `zip()` without an explicit `strict=` parameter
... 126 additional changes omitted for project

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
B905 176 0 0 0 176

@ntBre ntBre added the fixes Related to suggested fixes for violations label Oct 7, 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.

Thank you!

@ntBre ntBre changed the title Mark B905 and B912 strict fixes as unsafe [flake8-bugbear] Mark B905 and B912 fixes as unsafe Oct 7, 2025
@ntBre ntBre merged commit 2be73e9 into astral-sh:main Oct 7, 2025
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fixes Related to suggested fixes for violations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

B905 and B912 fixes should be unsafe

2 participants