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

print() from python operators end up with extra new line

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.9.0
    • Fix Version/s: 1.10.1
    • Component/s: None
    • Labels:
      None

      Description

      If I have the following as the callable for a PythonOperator:

      def print_stuff(ti, **kwargs):
          print("Hi from", __file__)
          print("Hi 2 from", __file__)
      

      I see the following in the log files

      [2017-12-13 10:45:53,901] {logging_mixin.py:84} INFO - Hi from /usr/local/airflow/dags/example/csv_to_parquet.py
      
      [2017-12-13 10:45:53,902] {logging_mixin.py:84} INFO - Hi 2 from /usr/local/airflow/dags/example/csv_to_parquet.py
      
      [2017-12-13 10:45:53,905] {base_task_runner.py:98} INFO - Subtask: [2017-12-13 10:45:53,904] {python_operator.py:90} INFO - Done. Returned value was: None
      

      Note the extra blank lines.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                ash Ash Berlin-Taylor
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: