You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2018/12/27 19:13:09 UTC

[GitHub] jmcarp commented on a change in pull request #4362: [AIRFLOW-3559] Add missing options to DatadogHook.

jmcarp commented on a change in pull request #4362: [AIRFLOW-3559] Add missing options to DatadogHook.
URL: https://github.com/apache/incubator-airflow/pull/4362#discussion_r244210751
 
 

 ##########
 File path: airflow/contrib/hooks/datadog_hook.py
 ##########
 @@ -47,26 +47,15 @@ def __init__(self, datadog_conn_id='datadog_default'):
         # for all metric submissions.
         self.host = conn.host
 
-        if self.api_key is None:
-            raise AirflowException("api_key must be specified in the "
-                                   "Datadog connection details")
-        if self.app_key is None:
-            raise AirflowException("app_key must be specified in the "
-                                   "Datadog connection details")
-
         self.log.info("Setting up api keys for Datadog")
-        options = {
-            'api_key': self.api_key,
-            'app_key': self.app_key
-        }
-        initialize(**options)
+        initialize(api_key=self.api_key, app_key=self.app_key)
 
     def validate_response(self, response):
         if response['status'] != 'ok':
             self.log.error("Datadog returned: %s", response)
             raise AirflowException("Error status received from Datadog")
 
-    def send_metric(self, metric_name, datapoint, tags=None):
+    def send_metric(self, metric_name, datapoint, tags=None, type_=None, interval=None):
 
 Review comment:
   The option is called `type` in the datadog docs, and I appended an underscore to avoid shadowing the `type` builtin in python.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services