You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/08/10 07:51:55 UTC

[GitHub] [airflow] sw1010 opened a new issue #17527: Broken json_client

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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] boring-cyborg[bot] commented on issue #17527: Broken json_client

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #17527:
URL: https://github.com/apache/airflow/issues/17527#issuecomment-895811251


   Thanks for opening your first issue here! Be sure to follow the issue template!
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] uranusjr commented on issue #17527: Broken json_client

Posted by GitBox <gi...@apache.org>.
uranusjr commented on issue #17527:
URL: https://github.com/apache/airflow/issues/17527#issuecomment-895815549


   This was probably missed when we migrated from requests to httpx. Would you be able to submit a pull request for this?


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] kaxil closed issue #17527: Broken json_client

Posted by GitBox <gi...@apache.org>.
kaxil closed issue #17527:
URL: https://github.com/apache/airflow/issues/17527


   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org