Skip to content

Commit c420dbd

Browse files
authored
Bump Pylint to 2.5.3 (#9294)
1 parent e3e20e7 commit c420dbd

24 files changed

+101
-95
lines changed

β€Ž.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
- name: Cache pre-commit env
5858
uses: actions/cache@v2
5959
env:
60-
cache-name: cache-pre-commit-v2
60+
cache-name: cache-pre-commit-v3
6161
with:
6262
path: ~/.cache/pre-commit
6363
key: ${{ env.cache-name }}-${{ github.job }}-${{ hashFiles('.pre-commit-config.yaml') }}
@@ -90,7 +90,7 @@ jobs:
9090
- name: Cache pre-commit env
9191
uses: actions/cache@v2
9292
env:
93-
cache-name: cache-pre-commit
93+
cache-name: cache-pre-commit-v1
9494
with:
9595
path: ~/.cache/pre-commit
9696
key: ${{ env.cache-name }}-${{ github.job }}-${{ hashFiles('.pre-commit-config.yaml') }}

β€Žairflow/api_connexion/schemas/connection_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class Meta:
4343
# We will be able to remove this when we upgrade to marshmallow 3.
4444
# To remove it, we would need to set unknown=EXCLUDE in Meta
4545
@validates_schema(pass_original=True)
46-
def check_unknown_fields(self, data, original_data):
46+
def check_unknown_fields(self, data, original_data): # pylint: disable=unused-argument
4747
""" Validates unknown field """
4848
unknown = set(original_data) - set(self.fields)
4949
if unknown:

β€Žairflow/executors/debug_executor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def __init__(self):
4949
self.tasks_params: Dict[TaskInstanceKeyType, Dict[str, Any]] = {}
5050
self.fail_fast = conf.getboolean("debug", "fail_fast")
5151

52-
def execute_async(self, *args, **kwargs) -> None:
52+
def execute_async(self, *args, **kwargs) -> None: # pylint: disable=signature-differs
5353
"""
5454
The method is replaced by custom trigger_task implementation.
5555
"""

β€Žairflow/executors/local_executor.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,13 @@ def start(self) -> None:
153153
self.executor.workers_used = 0
154154
self.executor.workers_active = 0
155155

156+
# pylint: disable=unused-argument # pragma: no cover
156157
# noinspection PyUnusedLocal
157158
def execute_async(self,
158159
key: TaskInstanceKeyType,
159160
command: CommandType,
160161
queue: Optional[str] = None,
161-
executor_config: Optional[Any] = None) -> None: \
162-
# pylint: disable=unused-argument # pragma: no cover
162+
executor_config: Optional[Any] = None) -> None:
163163
"""
164164
Executes task asynchronously.
165165
@@ -175,6 +175,7 @@ def execute_async(self,
175175
self.executor.workers_active += 1
176176
local_worker.start()
177177

178+
# pylint: enable=unused-argument # pragma: no cover
178179
def sync(self) -> None:
179180
"""
180181
Sync will get called periodically by the heartbeat method.
@@ -224,12 +225,13 @@ def start(self) -> None:
224225
worker.start()
225226

226227
# noinspection PyUnusedLocal
227-
def execute_async(self,
228-
key: TaskInstanceKeyType,
229-
command: CommandType,
230-
queue: Optional[str] = None,
231-
executor_config: Optional[Any] = None) -> None: \
232-
# pylint: disable=unused-argument # pragma: no cover
228+
def execute_async(
229+
self,
230+
key: TaskInstanceKeyType,
231+
command: CommandType,
232+
queue: Optional[str] = None, # pylint: disable=unused-argument
233+
executor_config: Optional[Any] = None # pylint: disable=unused-argument
234+
) -> None:
233235
"""
234236
Executes task asynchronously.
235237

β€Žairflow/jobs/local_task_job.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,14 @@ def __init__(
7373
def _execute(self):
7474
self.task_runner = get_task_runner(self)
7575

76+
# pylint: disable=unused-argument
7677
def signal_handler(signum, frame):
7778
"""Setting kill signal handler"""
7879
self.log.error("Received SIGTERM. Terminating subprocesses")
7980
self.on_kill()
8081
raise AirflowException("LocalTaskJob received SIGTERM signal")
82+
83+
# pylint: enable=unused-argument
8184
signal.signal(signal.SIGTERM, signal_handler)
8285

8386
if not self.task_instance.check_and_change_state_before_execution(

β€Žairflow/models/pool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class Pool(Base):
5050
DEFAULT_POOL_NAME = 'default_pool'
5151

5252
def __repr__(self):
53-
return self.pool
53+
return str(self.pool) # pylint: disable=E0012
5454

5555
@staticmethod
5656
@provide_session

β€Žairflow/providers/google/cloud/example_dags/example_bigquery_dts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
requested_run_time={"seconds": int(time.time() + 60)},
9898
)
9999
run_id = (
100-
"{{ task_instance.xcom_pull('gcp_bigquery_start_transfer', " "key='run_id') }}"
100+
"{{ task_instance.xcom_pull('gcp_bigquery_start_transfer', key='run_id') }}"
101101
)
102102
# [END howto_bigquery_start_transfer]
103103

β€Žairflow/providers/google/cloud/hooks/functions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,9 @@ def upload_function_zip(self, location: str, zip_path: str, project_id: str) ->
145145
:return: The upload URL that was returned by generateUploadUrl method.
146146
:rtype: str
147147
"""
148+
# pylint: disable=no-member # noqa
148149
response = \
149-
self.get_conn().projects().locations().functions().generateUploadUrl( # pylint: disable=no-member # noqa
150+
self.get_conn().projects().locations().functions().generateUploadUrl(
150151
parent=self._full_location(project_id, location)
151152
).execute(num_retries=self.num_retries)
152153

β€Žairflow/providers/google/cloud/hooks/gcs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def provide_file(
273273
self,
274274
bucket_name: Optional[str] = None,
275275
object_name: Optional[str] = None,
276-
object_url: Optional[str] = None
276+
object_url: Optional[str] = None # pylint: disable=unused-argument
277277
):
278278
"""
279279
Downloads the file to a temporary directory and returns a file handle

β€Žairflow/sensors/base_sensor_operator.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,7 @@ def mode_getter(_):
199199

200200
def mode_setter(_, value):
201201
if value != 'poke':
202-
raise ValueError(
203-
f"cannot set mode to 'poke'.")
202+
raise ValueError("cannot set mode to 'poke'.")
204203

205204
if not issubclass(cls_type, BaseSensorOperator):
206205
raise ValueError(f"poke_mode_only decorator should only be "

0 commit comments

Comments
 (0)