airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject incubator-airflow git commit: [AIRFLOW-2034] Fix mixup between %s and {} when using str.format Convention is to use .format for string formating oustide logging, else use lazy format See comment in related issue https://github.com/apache/incubator-airflo
Date Sun, 25 Feb 2018 11:32:49 GMT
Repository: incubator-airflow
Updated Branches:
  refs/heads/master caa8fd9d3 -> 6efe2e3ce


[AIRFLOW-2034] Fix mixup between %s and {} when using str.format
Convention is to use .format for string formating oustide logging, else use lazy format
See comment in related issue
https://github.com/apache/incubator-airflow/pull/2823/files
Identified problematic case using following command line
.git/COMMIT_EDITMSG:`grep -r '%s'./* | grep '\.format('`

Closes #2976 from knil-sama/fix-mixup-format-str


Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/6efe2e3c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/6efe2e3c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/6efe2e3c

Branch: refs/heads/master
Commit: 6efe2e3ce050264b580d11f3cffb109e8aef5bbd
Parents: caa8fd9
Author: knil-sama <clement.demonchy@jobteaser.com>
Authored: Sun Feb 25 12:32:43 2018 +0100
Committer: Bolke de Bruin <bolke@xs4all.nl>
Committed: Sun Feb 25 12:32:43 2018 +0100

----------------------------------------------------------------------
 airflow/hooks/slack_hook.py                  | 2 +-
 airflow/task/task_runner/base_task_runner.py | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6efe2e3c/airflow/hooks/slack_hook.py
----------------------------------------------------------------------
diff --git a/airflow/hooks/slack_hook.py b/airflow/hooks/slack_hook.py
index cd47573..0672675 100644
--- a/airflow/hooks/slack_hook.py
+++ b/airflow/hooks/slack_hook.py
@@ -52,5 +52,5 @@ class SlackHook(BaseHook):
         rc = sc.api_call(method, **api_params)
 
         if not rc['ok']:
-            msg = "Slack API call failed (%s)".format(rc['error'])
+            msg = "Slack API call failed ({})".format(rc['error'])
             raise AirflowException(msg)

http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/6efe2e3c/airflow/task/task_runner/base_task_runner.py
----------------------------------------------------------------------
diff --git a/airflow/task/task_runner/base_task_runner.py b/airflow/task/task_runner/base_task_runner.py
index 9a50390..946baf8 100644
--- a/airflow/task/task_runner/base_task_runner.py
+++ b/airflow/task/task_runner/base_task_runner.py
@@ -96,9 +96,9 @@ class BaseTaskRunner(LoggingMixin):
                 line = line.decode('utf-8')
             if len(line) == 0:
                 break
-            self.log.info(u'Job {}: Subtask {} %s'.format(
-                self._task_instance.job_id, self._task_instance.task_id),
-                line.rstrip('\n'))
+            self.log.info('Job %s: Subtask %s %s',
+                          self._task_instance.job_id, self._task_instance.task_id,
+                          line.rstrip('\n'))
 
     def run_command(self, run_with, join_args=False):
         """


Mime
View raw message