[ 
https://issues.apache.org/jira/browse/AIRFLOW-3519?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16736002#comment-16736002
 ] 

Felix Uellendall edited comment on AIRFLOW-3519 at 1/7/19 4:04 PM:
-------------------------------------------------------------------

I would rather change the response_check to return True if it is in 
response.text instead of response.content.
Because response.text is the decoded response of response.content. See 
http://docs.python-requests.org/en/master/user/quickstart/#response-content

What do you think [~Arun Ambikapathi] ?


was (Author: feluelle):
I would rather change the response_check to return True if it is in 
response.text instead of response.content.
Because response.text is the decoded response of response.content.

What do you think [~Arun Ambikapathi] ?

> example_http_operator is failing due to 
> ----------------------------------------
>
>                 Key: AIRFLOW-3519
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-3519
>             Project: Apache Airflow
>          Issue Type: Bug
>         Environment: Windows 10 professional edition.Apache airflow 
>            Reporter: Arunachalam Ambikapathi
>            Assignee: Felix Uellendall
>            Priority: Minor
>
> When example_http_operator DAG is called from command line, 
>  ./airflow trigger_dag example_http_operator
> it was throwing error 
>  [2018-12-13 10:37:41,892]
> {logging_mixin.py:95}
> INFO - [2018-12-13 10:37:41,892]
> {http_hook.py:126}
> INFO - Sending 'GET' to url: [https://www.google.com/]
> [2018-12-13 10:37:41,992]
> {logging_mixin.py:95}
> WARNING - 
> /home/arun1/.local/lib/python3.5/site-packages/urllib3/connectionpool.py:847: 
> InsecureRequestWarning: Unverified HTTPS request is being made. Adding 
> certificate verification is strongly advised. See: 
> [https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings]
>  InsecureRequestWarning)
>  [2018-12-13 10:37:42,064]
> {models.py:1760}
> *ERROR - a bytes-like object is required, not 'str'*
> This may be due to this was not tested in python3.5 version.
>  *Fix:*
>  I changed the dag to this and tested it is working.
> from 
> response_check=lambda response: True if "Google" in response.content else 
> False,
> to 
> response_check=lambda response: True if *b'Google'* in response.content else 
> False,
> Please apply this in the example it would help new users a lot.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to