From 5ba5917fefcccc933542d449d11079f40c71eaa5 Mon Sep 17 00:00:00 2001 From: Charles-Andre Bouffard Date: Fri, 14 Dec 2018 11:01:30 -0500 Subject: [PATCH] Kwargs on the _send_event call This allows for less-strict function calls. --- luigi/contrib/datadog_metric.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/luigi/contrib/datadog_metric.py b/luigi/contrib/datadog_metric.py index bde76a6c17..0216dd0910 100644 --- a/luigi/contrib/datadog_metric.py +++ b/luigi/contrib/datadog_metric.py @@ -88,10 +88,10 @@ def handle_task_done(self, task): event_tags = tags + ["task_state:DONE"] self._send_event(title=title, text=text, tags=event_tags, alert_type='info', priority='low') - def _send_event(self, title=None, text=None, tags=[], alert_type='info', priority='normal'): - all_tags = tags + self.default_tags() + def _send_event(self, **params): + params['tags'] += self.default_tags - api.Event.create(title=title, text=text, tags=all_tags, alert_type=alert_type, priority=priority) + api.Event.create(params) def _send_gauge(self, metric_name, value, tags=[]): all_tags = tags + self.default_tags()