[ 
https://issues.apache.org/jira/browse/AIRFLOW-4543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17098027#comment-17098027
 ] 

ASF GitHub Bot commented on AIRFLOW-4543:
-----------------------------------------

kaxil commented on a change in pull request #5519:
URL: https://github.com/apache/airflow/pull/5519#discussion_r418983365



##########
File path: airflow/providers/slack/hooks/slack.py
##########
@@ -27,29 +28,50 @@
 # noinspection PyAbstractClass
 class SlackHook(BaseHook):
     """
+    Creates a Slack connection, to be used for calls.
     Takes both Slack API token directly and connection that has Slack API 
token.
-
     If both supplied, Slack API token will be used.
+    Exposes also the rest of slack.WebClient args.
 
     :param token: Slack API token
+    :type token: str
     :param slack_conn_id: connection that has Slack API token in the password 
field
+    :type slack_conn_id: str
+    :param use_session: A boolean specifying if the client should take 
advantage of
+        connection pooling. Default is True.
+    :type base_url: bool
+    :param base_url: A string representing the Slack API base URL. Default is
+        `https://www.slack.com/api/`
+    :type base_url: str
+    :param timeout: The maximum number of seconds the client will wait
+        to connect and receive a response from Slack.
+        Default is 30 seconds.
+    :type timeout: int
     """
-    def __init__(self, token: Optional[str] = None, slack_conn_id: 
Optional[str] = None) -> None:
+
+    def __init__(
+        self,
+        token: Optional[str] = None,
+        slack_conn_id: Optional[str] = None,
+        **client_args: Any,
+    ) -> None:
         super().__init__()
-        self.token = self.__get_token(token, slack_conn_id)
+        token = self.__get_token(token, slack_conn_id)
+        self.client = WebClient(token, **client_args)

Review comment:
       Happy to merge it now as it is. 




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


> Update slack operator to support slackclient v2
> -----------------------------------------------
>
>                 Key: AIRFLOW-4543
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-4543
>             Project: Apache Airflow
>          Issue Type: Improvement
>          Components: hooks, operators
>            Reporter: Sergio Kef
>            Assignee: Sergio Kef
>            Priority: Major
>
> Official [Slack API for python|https://pypi.org/project/slackclient/] has 
> recently released 
> [v.2|https://github.com/slackapi/python-slackclient/wiki/Migrating-to-2.x0]
> Among others some important points:
>  * Async IO
>  * SSL and Proxy
>  * Dropping 2.7 support
> Opening this ticket to work on the upgrade. Current functionalities will be 
> migrated and will try to extend functionalities, if possible.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to