Skip to content

Commit

Permalink
Fixed broken json_client (#17529)
Browse files Browse the repository at this point in the history
The json_client depends on httpx and thus the response doesn't contain
the attribute 'ok'. In consequence, the missing attribute has been changed
to is_error.

closes: #17527

Co-authored-by: Szymon Wojciechowski <szymon.wojciechowski@here.com>
(cherry picked from commit fbddefe)
  • Loading branch information
sw1010 authored and kaxil committed Aug 17, 2021
1 parent 487ff2d commit 41688cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion airflow/api/client/json_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def _request(self, url, method='GET', json=None):
if json is not None:
params['json'] = json
resp = getattr(self._session, method.lower())(**params)
if not resp.ok:
if resp.is_error:
# It is justified here because there might be many resp types.
try:
data = resp.json()
Expand Down

0 comments on commit 41688cc

Please sign in to comment.