dchaplinsky commented on issue #4891: [AIRFLOW-4067] Telegram hook/operator to post messages to telegram channels URL: https://github.com/apache/airflow/pull/4891#issuecomment-471747313 Ok, what is the proper way to not to fail operator so downstream will continue the execution? On Mon, Mar 11, 2019 at 11:46 PM Kamil Breguła <[email protected]> wrote: > *@mik-laj* commented on this pull request. > ------------------------------ > > In airflow/contrib/operators/telegram_operator.py > <https://github.com/apache/airflow/pull/4891#discussion_r264444261>: > > > + > + self.telegram_conn_id = telegram_conn_id > + > + super(TelegramAPIOperator, self).__init__(*args, **kwargs) > + > + def execute(self, **kwargs): > + """ > + TelegramAPIOperator calls will not fail even if the call is not unsuccessful. > + It should not prevent a DAG from completing in success > + """ > + > + try: > + telegram_client = TelegramHook(telegram_conn_id=self.telegram_conn_id) > + telegram_client.call("POST", {"text": self.text}) > + except Exception as e: > + self.log.error("Cannot send a message to telegram, exception was '{}'".format(e)) > > Exceptions should not be ignored. > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > <https://github.com/apache/airflow/pull/4891#pullrequestreview-213102280>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/AAIAcnxCsIPjK0nt1wm-SzD4987n4-Hcks5vVs66gaJpZM4bnTS4> > . >
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
