You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by jh...@apache.org on 2021/08/12 01:41:12 UTC

[airflow] 01/03: Fixed broken json_client (#17529)

This is an automated email from the ASF dual-hosted git repository.

jhtimmins pushed a commit to branch v2-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 3d6db6d98522788be32c9b1a231d0e9a6941e50c
Author: sw1010 <sw...@interia.pl>
AuthorDate: Tue Aug 10 13:26:54 2021 +0200

    Fixed broken json_client (#17529)
    
    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 <sz...@here.com>
    (cherry picked from commit fbddefe5cbc0fe163c42ab070bc0d7e44c5cef5b)
---
 airflow/api/client/json_client.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/airflow/api/client/json_client.py b/airflow/api/client/json_client.py
index 2d5fd02..d87a3ae 100644
--- a/airflow/api/client/json_client.py
+++ b/airflow/api/client/json_client.py
@@ -32,7 +32,7 @@ class Client(api_client.Client):
         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()