coopergillan commented on a change in pull request #9947:
URL: https://github.com/apache/airflow/pull/9947#discussion_r459211038
##########
File path: airflow/providers/jenkins/operators/jenkins_job_trigger.py
##########
@@ -56,7 +59,7 @@ def jenkins_request_with_headers(jenkins_server, req):
# Jenkins's funky authentication means its nigh impossible to
distinguish errors.
if e.code in [401, 403, 500]:
raise JenkinsException(
- 'Error in request. Possibly authentication failed [%s]: %s' %
(e.code, e.msg)
+ 'Error in request. Possibly authentication failed [%s]: %s' %
(e.code, e.msg) # type: ignore
Review comment:
This one threw an error about `msg` not being an attribute of
`HTTPError`. How would `mypy` know that?
##########
File path: airflow/providers/jenkins/operators/jenkins_job_trigger.py
##########
@@ -197,7 +200,7 @@ def execute(self, context):
jenkins_server = self.get_hook().get_jenkins_server()
jenkins_response = self.build_job(jenkins_server)
build_number = self.poll_job_in_queue(
- jenkins_response['headers']['Location'], jenkins_server)
+ jenkins_response['headers']['Location'], jenkins_server) # type:
ignore
Review comment:
I can't seem to get this one either. It keeps saying this, but I can't
tell which one it wants me to change:
```
airflow/providers/jenkins/operators/jenkins_job_trigger.py:204: error:
Invalid index type "str" fo
"Union[str, Mapping[str, str]]"; expected type "Union[int, slice]"
jenkins_response['headers']['Location'], jenkins_server)
^
```
##########
File path: airflow/providers/jenkins/operators/jenkins_job_trigger.py
##########
@@ -160,7 +163,7 @@ def poll_job_in_queue(self, location, jenkins_server):
location_answer = jenkins_request_with_headers(
jenkins_server, Request(method='POST', url=location))
if location_answer is not None:
- json_response = json.loads(location_answer['body'])
+ json_response = json.loads(location_answer['body']) # type:
ignore
Review comment:
I couldn't make sense of this one:
```
incompatible type "Union[str, Mapping[str, str]]"; expected "Union[str,
bytes, bytearray]"
json_response = json.loads(location_answer['body'])
^
```
I can't tell which one should become `str, bytes, bytearray`.
----------------------------------------------------------------
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]