Skip to content

Commit

Permalink
Bump Pylint to 2.5.3 (#9294)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaxil committed Jun 27, 2020
1 parent e3e20e7 commit c420dbd
Show file tree
Hide file tree
Showing 24 changed files with 101 additions and 95 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Expand Up @@ -57,7 +57,7 @@ jobs:
- name: Cache pre-commit env
uses: actions/cache@v2
env:
cache-name: cache-pre-commit-v2
cache-name: cache-pre-commit-v3
with:
path: ~/.cache/pre-commit
key: ${{ env.cache-name }}-${{ github.job }}-${{ hashFiles('.pre-commit-config.yaml') }}
Expand Down Expand Up @@ -90,7 +90,7 @@ jobs:
- name: Cache pre-commit env
uses: actions/cache@v2
env:
cache-name: cache-pre-commit
cache-name: cache-pre-commit-v1
with:
path: ~/.cache/pre-commit
key: ${{ env.cache-name }}-${{ github.job }}-${{ hashFiles('.pre-commit-config.yaml') }}
Expand Down
2 changes: 1 addition & 1 deletion airflow/api_connexion/schemas/connection_schema.py
Expand Up @@ -43,7 +43,7 @@ class Meta:
# We will be able to remove this when we upgrade to marshmallow 3.
# To remove it, we would need to set unknown=EXCLUDE in Meta
@validates_schema(pass_original=True)
def check_unknown_fields(self, data, original_data):
def check_unknown_fields(self, data, original_data): # pylint: disable=unused-argument
""" Validates unknown field """
unknown = set(original_data) - set(self.fields)
if unknown:
Expand Down
2 changes: 1 addition & 1 deletion airflow/executors/debug_executor.py
Expand Up @@ -49,7 +49,7 @@ def __init__(self):
self.tasks_params: Dict[TaskInstanceKeyType, Dict[str, Any]] = {}
self.fail_fast = conf.getboolean("debug", "fail_fast")

def execute_async(self, *args, **kwargs) -> None:
def execute_async(self, *args, **kwargs) -> None: # pylint: disable=signature-differs
"""
The method is replaced by custom trigger_task implementation.
"""
Expand Down
18 changes: 10 additions & 8 deletions airflow/executors/local_executor.py
Expand Up @@ -153,13 +153,13 @@ def start(self) -> None:
self.executor.workers_used = 0
self.executor.workers_active = 0

# pylint: disable=unused-argument # pragma: no cover
# noinspection PyUnusedLocal
def execute_async(self,
key: TaskInstanceKeyType,
command: CommandType,
queue: Optional[str] = None,
executor_config: Optional[Any] = None) -> None: \
# pylint: disable=unused-argument # pragma: no cover
executor_config: Optional[Any] = None) -> None:
"""
Executes task asynchronously.
Expand All @@ -175,6 +175,7 @@ def execute_async(self,
self.executor.workers_active += 1
local_worker.start()

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

# noinspection PyUnusedLocal
def execute_async(self,
key: TaskInstanceKeyType,
command: CommandType,
queue: Optional[str] = None,
executor_config: Optional[Any] = None) -> None: \
# pylint: disable=unused-argument # pragma: no cover
def execute_async(
self,
key: TaskInstanceKeyType,
command: CommandType,
queue: Optional[str] = None, # pylint: disable=unused-argument
executor_config: Optional[Any] = None # pylint: disable=unused-argument
) -> None:
"""
Executes task asynchronously.
Expand Down
3 changes: 3 additions & 0 deletions airflow/jobs/local_task_job.py
Expand Up @@ -73,11 +73,14 @@ def __init__(
def _execute(self):
self.task_runner = get_task_runner(self)

# pylint: disable=unused-argument
def signal_handler(signum, frame):
"""Setting kill signal handler"""
self.log.error("Received SIGTERM. Terminating subprocesses")
self.on_kill()
raise AirflowException("LocalTaskJob received SIGTERM signal")

# pylint: enable=unused-argument
signal.signal(signal.SIGTERM, signal_handler)

if not self.task_instance.check_and_change_state_before_execution(
Expand Down
2 changes: 1 addition & 1 deletion airflow/models/pool.py
Expand Up @@ -50,7 +50,7 @@ class Pool(Base):
DEFAULT_POOL_NAME = 'default_pool'

def __repr__(self):
return self.pool
return str(self.pool) # pylint: disable=E0012

@staticmethod
@provide_session
Expand Down
Expand Up @@ -97,7 +97,7 @@
requested_run_time={"seconds": int(time.time() + 60)},
)
run_id = (
"{{ task_instance.xcom_pull('gcp_bigquery_start_transfer', " "key='run_id') }}"
"{{ task_instance.xcom_pull('gcp_bigquery_start_transfer', key='run_id') }}"
)
# [END howto_bigquery_start_transfer]

Expand Down
3 changes: 2 additions & 1 deletion airflow/providers/google/cloud/hooks/functions.py
Expand Up @@ -145,8 +145,9 @@ def upload_function_zip(self, location: str, zip_path: str, project_id: str) ->
:return: The upload URL that was returned by generateUploadUrl method.
:rtype: str
"""
# pylint: disable=no-member # noqa
response = \
self.get_conn().projects().locations().functions().generateUploadUrl( # pylint: disable=no-member # noqa
self.get_conn().projects().locations().functions().generateUploadUrl(
parent=self._full_location(project_id, location)
).execute(num_retries=self.num_retries)

Expand Down
2 changes: 1 addition & 1 deletion airflow/providers/google/cloud/hooks/gcs.py
Expand Up @@ -273,7 +273,7 @@ def provide_file(
self,
bucket_name: Optional[str] = None,
object_name: Optional[str] = None,
object_url: Optional[str] = None
object_url: Optional[str] = None # pylint: disable=unused-argument
):
"""
Downloads the file to a temporary directory and returns a file handle
Expand Down
3 changes: 1 addition & 2 deletions airflow/sensors/base_sensor_operator.py
Expand Up @@ -199,8 +199,7 @@ def mode_getter(_):

def mode_setter(_, value):
if value != 'poke':
raise ValueError(
f"cannot set mode to 'poke'.")
raise ValueError("cannot set mode to 'poke'.")

if not issubclass(cls_type, BaseSensorOperator):
raise ValueError(f"poke_mode_only decorator should only be "
Expand Down
3 changes: 2 additions & 1 deletion airflow/utils/orm_event_handlers.py
Expand Up @@ -32,7 +32,7 @@ def setup_event_handlers(engine):
"""
Setups event handlers.
"""
# pylint: disable=unused-argument
# pylint: disable=unused-argument, unused-variable
@event.listens_for(engine, "connect")
def connect(dbapi_connection, connection_record):
connection_record.info['pid'] = os.getpid()
Expand Down Expand Up @@ -78,3 +78,4 @@ def after_cursor_execute(conn, cursor, statement, parameters, context, executema
log.info("@SQLALCHEMY %s |$ %s |$ %s |$ %s ",
total, file_name, stack_info, statement.replace("\n", " ")
)
# pylint: enable=unused-argument, unused-variable
2 changes: 1 addition & 1 deletion airflow/utils/timeout.py
Expand Up @@ -33,7 +33,7 @@ def __init__(self, seconds=1, error_message='Timeout'):
self.seconds = seconds
self.error_message = error_message + ', PID: ' + str(os.getpid())

def handle_timeout(self, signum, frame):
def handle_timeout(self, signum, frame): # pylint: disable=unused-argument
"""
Logs information and raises AirflowTaskTimeout.
"""
Expand Down
3 changes: 2 additions & 1 deletion airflow/www/security.py
Expand Up @@ -456,9 +456,10 @@ def merge_pv(perm, view_menu):
all_perm_views = {role.permission_view_id for role in all_perm_view_by_user}

for role in dag_role:
# pylint: disable=no-member
# Get all the perm-view of the role
existing_perm_view_by_user = self.get_session.query(ab_perm_view_role)\
.filter(ab_perm_view_role.columns.role_id == role.id) # pylint: disable=no-member
.filter(ab_perm_view_role.columns.role_id == role.id)

existing_perms_views = {pv.permission_view_id for pv in existing_perm_view_by_user}
missing_perm_views = all_perm_views - existing_perms_views
Expand Down
41 changes: 21 additions & 20 deletions requirements/requirements-python3.6.txt
Expand Up @@ -28,7 +28,7 @@ PyYAML==5.3.1
Pygments==2.6.1
SQLAlchemy-JSONField==0.9.0
SQLAlchemy-Utils==0.36.6
SQLAlchemy==1.3.17
SQLAlchemy==1.3.18
Sphinx==3.1.1
Unidecode==1.1.1
WTForms==2.3.1
Expand Down Expand Up @@ -72,19 +72,19 @@ beautifulsoup4==4.7.1
billiard==3.6.3.0
black==19.10b0
blinker==1.4
boto3==1.14.8
boto3==1.14.11
boto==2.49.0
botocore==1.17.8
botocore==1.17.11
bowler==0.8.0
cached-property==1.5.1
cachetools==4.1.0
cassandra-driver==3.20.2
cattrs==1.0.0
celery==4.4.5
celery==4.4.6
certifi==2020.6.20
cffi==1.14.0
cfgv==3.1.0
cfn-lint==0.33.1
cfn-lint==0.33.2
cgroupspy==0.1.6
chardet==3.0.4
click==6.7
Expand All @@ -101,7 +101,7 @@ cryptography==2.9.2
curlify==2.2.1
cx-Oracle==7.3.0
dask==2.19.0
datadog==0.37.0
datadog==0.37.1
decorator==4.4.2
defusedxml==0.6.0
dill==0.3.2
Expand Down Expand Up @@ -159,7 +159,7 @@ google-cloud-monitoring==1.0.0
google-cloud-pubsub==1.6.0
google-cloud-redis==1.0.0
google-cloud-secret-manager==1.0.0
google-cloud-spanner==1.17.0
google-cloud-spanner==1.17.1
google-cloud-speech==1.3.2
google-cloud-storage==1.29.0
google-cloud-tasks==1.5.0
Expand All @@ -173,7 +173,7 @@ graphviz==0.14
greenlet==0.4.16
grpc-google-iam-v1==0.12.3
grpcio-gcp==0.2.2
grpcio==1.29.0
grpcio==1.30.0
gunicorn==19.10.0
hdfs==2.5.8
hmsclient==0.1.1
Expand All @@ -189,7 +189,7 @@ immutables==0.14
importlib-metadata==1.6.1
importlib-resources==2.0.1
inflection==0.5.0
ipdb==0.13.2
ipdb==0.13.3
ipython-genutils==0.2.0
ipython==7.15.0
iso8601==0.1.12
Expand All @@ -208,7 +208,7 @@ jsonschema==3.2.0
junit-xml==1.9
jupyter-client==6.1.3
jupyter-core==4.6.3
kombu==4.6.10
kombu==4.6.11
kubernetes==11.0.0
lazy-object-proxy==1.5.0
ldap3==2.7
Expand All @@ -224,7 +224,7 @@ monotonic==1.5
more-itertools==8.4.0
moto==1.3.14
msgpack==1.0.0
msrest==0.6.16
msrest==0.6.17
msrestazure==0.6.3
multi-key-dict==2.0.3
multidict==4.7.6
Expand Down Expand Up @@ -269,21 +269,21 @@ psutil==5.7.0
psycopg2-binary==2.8.5
ptyprocess==0.6.0
py4j==0.10.9
py==1.8.2
py==1.9.0
pyOpenSSL==19.1.0
pyarrow==0.17.1
pyasn1-modules==0.2.8
pyasn1==0.4.8
pycodestyle==2.6.0
pycountry==19.8.18
pycparser==2.20
pycryptodomex==3.9.7
pycryptodomex==3.9.8
pydata-google-auth==1.1.0
pydruid==0.5.8
pyexasol==0.13.1
pyflakes==2.2.0
pykerberos==1.2.1
pylint==2.4.4
pylint==2.5.3
pymongo==3.10.1
pymssql==2.1.4
pyodbc==4.0.30
Expand All @@ -293,7 +293,7 @@ pyrsistent==0.16.0
pysftp==0.2.9
pyspark==3.0.0
pytest-cov==2.10.0
pytest-forked==1.1.3
pytest-forked==1.2.0
pytest-instafail==0.4.2
pytest-rerunfailures==9.0
pytest-timeout==1.4.1
Expand Down Expand Up @@ -326,17 +326,17 @@ rsa==4.6
s3transfer==0.3.3
sasl==0.2.1
semver==2.10.2
sendgrid==6.3.1
sendgrid==6.4.1
sentinels==1.0.0
sentry-sdk==0.15.1
setproctitle==1.1.10
sh==1.13.1
simple-salesforce==1.1.0
six==1.15.0
slackclient==2.7.1
slackclient==2.7.2
smmap==3.0.4
snowballstemmer==2.0.0
snowflake-connector-python==2.2.7
snowflake-connector-python==2.2.8
snowflake-sqlalchemy==1.2.3
sortedcontainers==2.2.2
soupsieve==2.0.1
Expand All @@ -357,6 +357,7 @@ sphinxcontrib-serializinghtml==1.1.4
spython==0.0.84
sshpubkeys==3.1.0
sshtunnel==0.1.5
starkbank-ecdsa==1.0.0
statsd==3.3.0
swagger-ui-bundle==0.0.6
tableauserverclient==0.9
Expand All @@ -381,9 +382,9 @@ uritemplate==3.0.1
urllib3==1.25.9
vertica-python==0.10.4
vine==1.3.0
virtualenv==20.0.24
virtualenv==20.0.25
watchtower==0.7.3
wcwidth==0.2.4
wcwidth==0.2.5
websocket-client==0.57.0
wrapt==1.12.1
xmltodict==0.12.0
Expand Down

0 comments on commit c420dbd

Please sign in to comment.