r39132 closed pull request #3668: [AIRFLOW-2822] Fix HipChat Deprecation Warning URL: https://github.com/apache/incubator-airflow/pull/3668
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/airflow/contrib/operators/hipchat_operator.py b/airflow/contrib/operators/hipchat_operator.py index 381cd72cdf..adeca23079 100644 --- a/airflow/contrib/operators/hipchat_operator.py +++ b/airflow/contrib/operators/hipchat_operator.py @@ -99,24 +99,23 @@ class HipChatAPISendRoomNotificationOperator(HipChatAPIOperator): :param card: HipChat-defined card object :type card: dict """ - template_fields = ('token', 'room_id', 'message') + template_fields = ('token', 'room_id', 'message', 'message_format', + 'color', 'frm', 'attach_to', 'notify', 'card') ui_color = '#2980b9' @apply_defaults - def __init__(self, room_id, message, *args, **kwargs): + def __init__(self, room_id, message, message_format='html', + color='yellow', frm='airflow', attach_to=None, + notify=False, card=None, *args, **kwargs): super(HipChatAPISendRoomNotificationOperator, self).__init__(*args, **kwargs) self.room_id = room_id self.message = message - default_options = { - 'message_format': 'html', - 'color': 'yellow', - 'frm': 'airflow', - 'attach_to': None, - 'notify': False, - 'card': None - } - for (prop, default) in default_options.items(): - setattr(self, prop, kwargs.get(prop, default)) + self.message_format = message_format + self.color = color + self.frm = frm + self.attach_to = attach_to + self.notify = notify + self.card = card def prepare_request(self): params = { ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services