Uploaded image for project: 'Apache Airflow'
  1. Apache Airflow
  2. AIRFLOW-3519

example_http_operator is failing due to

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.10.2
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows 10 professional edition.Apache airflow

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                feluelle Felix Uellendall
                Reporter:
                Arun Ambikapathi Arunachalam Ambikapathi
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: