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 42b6e2f64174f397b6c59fcf942c815f7354c2be
Author: sw1010 <s...@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 <szymon.wojciechow...@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()

Reply via email to