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 2019/01/10 17:57:17 UTC

[GitHub] feng-tao closed pull request #4466: [AIRFLOW-3657] Fix zendesk integration

feng-tao closed pull request #4466: [AIRFLOW-3657] Fix zendesk integration
URL: https://github.com/apache/airflow/pull/4466
 
 
   

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/hooks/zendesk_hook.py b/airflow/hooks/zendesk_hook.py
index 3cf8353344..a6f7583450 100644
--- a/airflow/hooks/zendesk_hook.py
+++ b/airflow/hooks/zendesk_hook.py
@@ -33,7 +33,8 @@ def __init__(self, zendesk_conn_id):
     def get_conn(self):
         conn = self.get_connection(self.__zendesk_conn_id)
         self.__url = "https://" + conn.host
-        return Zendesk(self.__url, conn.login, conn.password, True)
+        return Zendesk(zdesk_url=self.__url, zdesk_email=conn.login, zdesk_password=conn.password,
+                       zdesk_token=True)
 
     def __handle_rate_limit_exception(self, rate_limit_exception):
         """
diff --git a/tests/contrib/hooks/test_zendesk_hook.py b/tests/contrib/hooks/test_zendesk_hook.py
index 99dd8926dc..51be042086 100644
--- a/tests/contrib/hooks/test_zendesk_hook.py
+++ b/tests/contrib/hooks/test_zendesk_hook.py
@@ -92,8 +92,8 @@ def test_zdesk_is_inited_correctly(self, mock_zendesk):
         zendesk_hook = ZendeskHook("conn_id")
         zendesk_hook.get_connection = mock.Mock(return_value=conn_mock)
         zendesk_hook.get_conn()
-        mock_zendesk.assert_called_with('https://conn_host', 'conn_login',
-                                        'conn_pass', True)
+        mock_zendesk.assert_called_with(zdesk_url='https://conn_host', zdesk_email='conn_login',
+                                        zdesk_password='conn_pass', zdesk_token=True)
 
     @mock.patch("airflow.hooks.zendesk_hook.Zendesk")
     def test_zdesk_sideloading_works_correctly(self, mock_zendesk):


 

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