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

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

stale[bot] closed pull request #3575: [AIRFLOW-2711] zendesk hook doesn't 
handle search endpoint properly
URL: https://github.com/apache/incubator-airflow/pull/3575
 
 
   

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..102556a5cd 100644
--- a/airflow/hooks/zendesk_hook.py
+++ b/airflow/hooks/zendesk_hook.py
@@ -74,7 +74,11 @@ def call(self, path, query=None, get_all_pages=True, 
side_loading=False):
                 self.__handle_rate_limit_exception(rle)
 
         # Find the key with the results
-        keys = [path.split("/")[-1].split(".json")[0]]
+        key = path.split("/")[-1].split(".json")[0]
+        if key == 'search':
+            keys = ['results']
+        else:
+            keys = [key]
         next_page = results['next_page']
         if side_loading:
             keys += query['include'].split(',')


 

----------------------------------------------------------------
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:
[email protected]


> zendesk hook doesn't handle search endpoint properly
> ----------------------------------------------------
>
>                 Key: AIRFLOW-2711
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-2711
>             Project: Apache Airflow
>          Issue Type: Bug
>    Affects Versions: 1.9.0
>            Reporter: Chris Chow
>            Priority: Major
>
> the zendesk hook assumes that the api's response includes the expected result 
> in the key with the same name as the api endpoint, e.g. that the results of a 
> query to /api/v2/users.json includes the key 'users'. /api/v2/search.json 
> actually includes results under the key 'results'



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to