Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing space to log message in task completion logs #11934

Merged
merged 1 commit into from
Oct 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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',
Copy link
Member

@turbaszek turbaszek Oct 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'dag_id=%s, task_id=%s, execution_date=%s, start_date=%s, end_date=%s',
'(dag_id=%s, task_id=%s, execution_date=%s, start_date=%s, end_date=%s)',

Just an idea to make it more "structured" but definitely not a blocker

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