Skip to content

Commit b64477c

Browse files
authored
Enable ruff PLW0127 rule (#57298)
1 parent 8ccff84 commit b64477c

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

airflow-core/src/airflow/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import atexit
2121
import functools
22-
import json
22+
import json as json_lib
2323
import logging
2424
import os
2525
import sys
@@ -122,7 +122,7 @@
122122
AsyncSession: Callable[..., SAAsyncSession]
123123

124124
# The JSON library to use for DAG Serialization and De-Serialization
125-
json = json
125+
json = json_lib
126126

127127
# Display alerts on the dashboard
128128
# Useful for warning about setup issues or announcing changes to end users

providers/common/sql/tests/unit/common/sql/operators/test_sql.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ def test_fail_all_checks_check(self, monkeypatch):
362362
("X", "min", -1),
363363
("X", "max", 20),
364364
]
365-
operator = operator = self._construct_operator(monkeypatch, self.valid_column_mapping, records)
365+
operator = self._construct_operator(monkeypatch, self.valid_column_mapping, records)
366366
with pytest.raises(AirflowException):
367367
operator.execute(context=MagicMock())
368368

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,8 @@ extend-select = [
587587
"TID25", # flake8-tidy-imports rules
588588
"E", # pycodestyle rules
589589
"W", # pycodestyle rules
590+
# Warning (PLW) re-implemented in ruff from Pylint
591+
"PLW0127", # Self-assignment of variable
590592
# Per rule enables
591593
"RUF006", # Checks for asyncio dangling task
592594
"RUF015", # Checks for unnecessary iterable allocation for first element

0 commit comments

Comments
 (0)