Skip to content

Commit

Permalink
Add missing space to log message in task completion logs (apache#11934)
Browse files Browse the repository at this point in the history
Previously it looked like this

    INFO - Marking task as SUCCESS.dag_id=scenario1_case1_1_1, ...

Now it looks like

    INFO - Marking task as SUCCESS. dag_id=scenario1_case1_1_1, ...
  • Loading branch information
ashb authored and Szymon Nieradka committed Nov 1, 2020
1 parent b2a6303 commit cb69a6e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions airflow/models/taskinstance.py
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,7 @@ def _run_raw_task(
self.refresh_from_db(lock_for_update=True)
self.state = State.SKIPPED
self.log.info(
'Marking task as SKIPPED.'
'Marking task as SKIPPED. '
'dag_id=%s, task_id=%s, execution_date=%s, start_date=%s, end_date=%s',
self.dag_id,
self.task_id,
Expand Down Expand Up @@ -1123,7 +1123,7 @@ def _run_raw_task(
# Recording SUCCESS
self.end_date = timezone.utcnow()
self.log.info(
'Marking task as SUCCESS.'
'Marking task as SUCCESS. '
'dag_id=%s, task_id=%s, execution_date=%s, start_date=%s, end_date=%s',
self.dag_id,
self.task_id,
Expand Down
4 changes: 2 additions & 2 deletions tests/cli/commands/test_task_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ def test_logging_with_run_task(self):
self.assert_log_line("Log from TI Logger", logs_list)
self.assert_log_line("Log from Print statement", logs_list, expect_from_logging_mixin=True)

self.assertIn(f"INFO - Marking task as SUCCESS.dag_id={self.dag_id}, "
self.assertIn(f"INFO - Marking task as SUCCESS. dag_id={self.dag_id}, "
f"task_id={self.task_id}, execution_date=20170101T000000", logs)

@mock.patch("airflow.task.task_runner.standard_task_runner.CAN_FORK", False)
Expand All @@ -343,7 +343,7 @@ def test_logging_with_run_task_subprocess(self):

self.assertIn(f"INFO - Running: ['airflow', 'tasks', 'run', '{self.dag_id}', "
f"'{self.task_id}', '{self.execution_date_str}',", logs)
self.assertIn(f"INFO - Marking task as SUCCESS.dag_id={self.dag_id}, "
self.assertIn(f"INFO - Marking task as SUCCESS. dag_id={self.dag_id}, "
f"task_id={self.task_id}, execution_date=20170101T000000", logs)

def test_log_file_template_with_run_task(self):
Expand Down

0 comments on commit cb69a6e

Please sign in to comment.