mik-laj commented on a change in pull request #4891: Telegram hook/operator to 
post messages to telegram channels
URL: https://github.com/apache/airflow/pull/4891#discussion_r264048383
 
 

 ##########
 File path: airflow/contrib/operators/telegram_operator.py
 ##########
 @@ -0,0 +1,89 @@
+import json
+import telegram
+
+from airflow.models import BaseOperator
+from airflow.utils.decorators import apply_defaults
+from airflow.exceptions import AirflowException
+from hooks.telegram_hook import TelegramHook
+
+
+class TelegramAPIOperator(BaseOperator):
+    """
+    Base Telegram Operator
+    The TelegramAPIPostOperator is derived from this operator.
+    In the future additional Telegram bot API Operators will be derived from 
this class as well
+    :param telegram_conn_id: Telegram connection ID which its password is 
Telegram API token
+    :type telegram_conn_id: str
+    :param token: Telergram bot API token
+    :type token: str
+    """
+
+    @apply_defaults
+    def __init__(self, telegram_conn_id=None, token=None, *args, **kwargs):
 
 Review comment:
   ```suggestion
       def __init__(self, telegram_conn_id=None, token=None, *args, **kwargs):
   ```
   Keeping passwords in other places is a security risk.

----------------------------------------------------------------
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

Reply via email to