mik-laj commented on a change in pull request #5634: [AIRFLOW-5012][WIP] Add
typehints for gcp_*_hook.py
URL: https://github.com/apache/airflow/pull/5634#discussion_r306003526
##########
File path: airflow/contrib/hooks/gcp_transfer_hook.py
##########
@@ -180,14 +188,15 @@ def list_transfer_job(self, request_filter=None,
**kwargs):
if request_filter is None:
if 'filter' in kwargs:
request_filter = kwargs['filter']
- DeprecationWarning("Use 'request_filter' instead of 'filter'")
+ assert isinstance(request_filter, Dict)
+ warnings.warn("Use 'request_filter' instead of 'filter'",
DeprecationWarning)
else:
- TypeError("list_transfer_job missing 1 required positional
argument: 'request_filter'")
+ raise TypeError("list_transfer_job missing 1 required
positional argument: 'request_filter'")
conn = self.get_conn()
request_filter = self._inject_project_id(request_filter, FILTER,
FILTER_PROJECT_ID)
request = conn.transferJobs().list(filter=json.dumps(request_filter))
# pylint: disable=no-member
- jobs = []
+ jobs: List[Dict] = []
Review comment:
It will delete all annotations for variables tomorrow. :_;
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services