sw1010 opened a new issue #17527:
URL: https://github.com/apache/airflow/issues/17527


   **Apache Airflow version**: 2.1.2
   
   **Apache Airflow Provider versions** (please include all providers that are 
relevant to your bug):
   apache-airflow-providers-ftp==2.0.0
   apache-airflow-providers-imap==2.0.0
   apache-airflow-providers-sqlite==2.0.0
   
   **Environment**:
   
   - **OS** (e.g. from /etc/os-release): Ubuntu
   
   **What happened**:
   
   ```
   Traceback (most recent call last):
     File "./bug.py", line 6, in <module>
       response = airflow_client.trigger_dag(
     File 
"/home/user/my_project/venv38/lib/python3.8/site-packages/airflow/api/client/json_client.py",
 line 54, in trigger_dag
       data = self._request(
     File 
"/home/user/my_project/venv38/lib/python3.8/site-packages/airflow/api/client/json_client.py",
 line 38, in _request
       if not resp.ok:
   AttributeError: 'Response' object has no attribute 'ok'
   ```
   
   
   Json Client depends on httpx, which doesn't provide the attribute 'ok' and 
according to their spec (https://www.python-httpx.org/compatibility/) they are 
not going to do that. In the consequence handling the response crashes. 
   
   **What you expected to happen**:
   
   The expected outcome is to handle the response smoothly.
   
   **How to reproduce it**:
   ```
   #!/usr/bin/env python3
   
   from airflow.api.client import json_client
   
   airflow_client = json_client.Client("http://rnd.airflow.mydomain.com";, None)
   response = airflow_client.trigger_dag("my_dag", 
execution_date="2021-04-27T00:00:00")
   ```
   
   
   
   
   **Anything else we need to know**:
   The problem always occurs.


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to