Skip to content

Commit aa2cb55

Browse files
authored
Remove remaining pylint: disable comments (#19541)
1 parent de99005 commit aa2cb55

File tree

17 files changed

+23
-24
lines changed

17 files changed

+23
-24
lines changed

airflow/compat/asyncio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# under the License.
1717

1818
try:
19-
from asyncio import create_task # pylint: disable=unused-import
19+
from asyncio import create_task
2020
except ImportError:
2121
# create_task is not present in Python 3.6. Once Airflow is at 3.7+, we can
2222
# remove this helper.

airflow/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def _get_config_value_from_secret_backend(config_key):
9696
if not secrets_client:
9797
return None
9898
return secrets_client.get_config(config_key)
99-
except Exception as e: # pylint: disable=broad-except
99+
except Exception as e:
100100
raise AirflowConfigException(
101101
'Cannot retrieve config from alternative secrets backend. '
102102
'Make sure it is configured properly and that the Backend '

airflow/jobs/triggerer_job.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def on_kill(self):
8787
"""
8888
self.runner.stop = True
8989

90-
def _exit_gracefully(self, signum, frame) -> None: # pylint: disable=unused-argument
90+
def _exit_gracefully(self, signum, frame) -> None:
9191
"""Helper method to clean up processor_agent to avoid leaving orphan processes."""
9292
# The first time, try to exit nicely
9393
if not self.runner.stop:
@@ -104,7 +104,7 @@ def _execute(self) -> None:
104104
self.runner.start()
105105
# Start our own DB loop in the main thread
106106
self._run_trigger_loop()
107-
except Exception: # pylint: disable=broad-except
107+
except Exception:
108108
self.log.exception("Exception when executing TriggererJob._run_trigger_loop")
109109
raise
110110
finally:
@@ -227,8 +227,7 @@ def __init__(self):
227227

228228
def run(self):
229229
"""Sync entrypoint - just runs arun in an async loop."""
230-
# Pylint complains about this with a 3.6 base, can remove with 3.7+
231-
asyncio.run(self.arun()) # pylint: disable=no-member
230+
asyncio.run(self.arun())
232231

233232
async def arun(self):
234233
"""
@@ -288,7 +287,7 @@ async def cleanup_finished_triggers(self):
288287
ones that have exited, optionally warning users if the exit was
289288
not normal.
290289
"""
291-
for trigger_id, details in list(self.triggers.items()): # pylint: disable=too-many-nested-blocks
290+
for trigger_id, details in list(self.triggers.items()):
292291
if details["task"].done():
293292
# Check to see if it exited for good reasons
294293
try:

airflow/models/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ def get_connection_from_secrets(cls, conn_id: str) -> 'Connection':
388388
conn = secrets_backend.get_connection(conn_id=conn_id)
389389
if conn:
390390
return conn
391-
except Exception: # pylint: disable=broad-except
391+
except Exception:
392392
log.exception(
393393
'Unable to retrieve connection from secrets backend (%s). '
394394
'Checking subsequent secrets backend.',

airflow/models/variable.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def check_for_write_conflict(key: str) -> None:
246246
"from {cls}".format(key=key, cls=secrets_backend.__class__.__name__)
247247
)
248248
return
249-
except Exception: # pylint: disable=broad-except
249+
except Exception:
250250
log.exception(
251251
'Unable to retrieve variable from secrets backend (%s). '
252252
'Checking subsequent secrets backend.',
@@ -267,7 +267,7 @@ def get_variable_from_secrets(key: str) -> Optional[str]:
267267
var_val = secrets_backend.get_variable(key=key)
268268
if var_val is not None:
269269
return var_val
270-
except Exception: # pylint: disable=broad-except
270+
except Exception:
271271
log.exception(
272272
'Unable to retrieve variable from secrets backend (%s). '
273273
'Checking subsequent secrets backend.',

airflow/providers/amazon/aws/hooks/base_aws.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def _create_session_with_assume_role(self, session_kwargs: Dict[str, Any]) -> bo
127127
method="sts-assume-role",
128128
)
129129
session = botocore.session.get_session()
130-
session._credentials = credentials # pylint: disable=protected-access
130+
session._credentials = credentials
131131
region_name = self.basic_session.region_name
132132
session.set_config_variable("region", region_name)
133133
return boto3.session.Session(botocore_session=session, **session_kwargs)

airflow/providers/amazon/aws/operators/emr_containers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class EMRContainerOperator(BaseOperator):
6262
template_fields = ["name", "virtual_cluster_id", "execution_role_arn", "release_label", "job_driver"]
6363
ui_color = "#f9c915"
6464

65-
def __init__( # pylint: disable=too-many-arguments
65+
def __init__(
6666
self,
6767
*,
6868
name: str,

airflow/providers/docker/decorators/docker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def _get_python_source(self):
123123
return res
124124

125125

126-
T = TypeVar("T", bound=Callable) # pylint: disable=invalid-name
126+
T = TypeVar("T", bound=Callable)
127127

128128

129129
def docker_task(

airflow/providers/google/cloud/hooks/dataproc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ def instantiate_workflow_template(
672672
retry: Optional[Retry] = None,
673673
timeout: Optional[float] = None,
674674
metadata: Optional[Sequence[Tuple[str, str]]] = None,
675-
): # pylint: disable=too-many-arguments
675+
):
676676
"""
677677
Instantiates a template and begins execution.
678678

airflow/sensors/date_time.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,6 @@ def execute(self, context):
9191
method_name="execute_complete",
9292
)
9393

94-
def execute_complete(self, context, event=None): # pylint: disable=unused-argument
94+
def execute_complete(self, context, event=None):
9595
"""Callback for when the trigger fires - returns immediately."""
9696
return None

0 commit comments

Comments
 (0)