Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AP-1840] bump zenpy from 2.0.0 to 2.0.52 #1183

Merged
merged 2 commits into from
Sep 13, 2024
Merged

Conversation

amofakhar
Copy link
Contributor

@amofakhar amofakhar commented Sep 12, 2024

Context

Describe the problem your PR is trying to solve

Types of changes

What types of changes does your code introduce to PipelineWise?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • Description above provides context of the change
  • I have added tests that prove my fix is effective or that my feature works
  • Unit tests for changes (not needed for documentation changes)
  • CI checks pass with my changes
  • Branch name starts with AP-NNN (if applicable. AP-NNN = JIRA ID)
  • Relevant documentation is updated including usage instructions

Details from ticket: AP-1840

Zendesk :: pagination error

h2. Problem

{noformat}time=2024-09-12 08:25:24 logger_name=tap_zendesk log_level=CRITICAL message={"errors": [{"code": "InvalidPaginationDepth", "title": "Pagination requests using Offset Pagination are limited to page 100 or up to 10000 records (page * per_page)", "detail": "There are limits to the page depth in Offset Pagination. Offset Pagination will be deprecated fully in the near future.\nPlease switch to Cursor Pagination at the earliest. Cursor Pagination does not have any limits.\nSee https://developer.zendesk.com/documentation/api-basics/pagination/comparing-cursor-pagination-and-offset-pagination\n", "source": {"parameter": "page"}, "status": "400", "links": {"related": {"title": "Pagination | Zendesk Developer Docs", "href": "https://developer.zendesk.com/api-reference/introduction/pagination"}, "announcement": {"title": "New limits for offset-based pagination | Zendesk Article", "href": "https://support.zendesk.com/hc/en-us/articles/5591904358938-New-limits-for-offset-based-pagination"}}}]}
Traceback (most recent call last):
File "/home/pipelinewise/pipelinewise/.virtualenvs/tap-zendesk/bin/tap-zendesk", line 8, in
sys.exit(main())
File "/home/pipelinewise/pipelinewise/.virtualenvs/tap-zendesk/lib/python3.8/site-packages/singer/utils.py", line 229, in wrapped
return fnc(*args, **kwargs)
File "/home/pipelinewise/pipelinewise/singer-connectors/tap-zendesk/tap_zendesk/init.py", line 234, in main
do_sync(client, parsed_args.catalog, state, parsed_args.config['start_date'])
File "/home/pipelinewise/pipelinewise/singer-connectors/tap-zendesk/tap_zendesk/init.py", line 140, in do_sync
counter_value = sync_stream(state, start_date, instance)
File "/home/pipelinewise/pipelinewise/singer-connectors/tap-zendesk/tap_zendesk/sync.py", line 32, in sync_stream
for (stream, record) in instance.sync(state):
File "/home/pipelinewise/pipelinewise/singer-connectors/tap-zendesk/tap_zendesk/streams.py", line 473, in sync
for membership in memberships:
File "/home/pipelinewise/pipelinewise/.virtualenvs/tap-zendesk/lib/python3.8/site-packages/zenpy/lib/generator.py", line 156, in next
return self.next()
File "/home/pipelinewise/pipelinewise/.virtualenvs/tap-zendesk/lib/python3.8/site-packages/zenpy/lib/generator.py", line 45, in next
self.handle_pagination()
File "/home/pipelinewise/pipelinewise/.virtualenvs/tap-zendesk/lib/python3.8/site-packages/zenpy/lib/generator.py", line 54, in handle_pagination
self._response_json = self.get_next_page(page_num=page_num, page_size=page_size)
File "/home/pipelinewise/pipelinewise/.virtualenvs/tap-zendesk/lib/python3.8/site-packages/zenpy/lib/generator.py", line 185, in get_next_page
return super(ZendeskResultGenerator, self).get_next_page(page_num, page_size)
File "/home/pipelinewise/pipelinewise/.virtualenvs/tap-zendesk/lib/python3.8/site-packages/zenpy/lib/generator.py", line 71, in get_next_page
response = self.response_handler.api._get(url, raw_response=True, params=params)
File "/home/pipelinewise/pipelinewise/.virtualenvs/tap-zendesk/lib/python3.8/site-packages/zenpy/lib/api.py", line 97, in _get
response = self._call_api(self.session.get, url, timeout=self.timeout, **kwargs)
File "/home/pipelinewise/pipelinewise/.virtualenvs/tap-zendesk/lib/python3.8/site-packages/zenpy/lib/api.py", line 134, in _call_api
self._check_response(response)
File "/home/pipelinewise/pipelinewise/.virtualenvs/tap-zendesk/lib/python3.8/site-packages/zenpy/lib/api.py", line 273, in _check_response
raise APIException(json.dumps(_json), response=response)
zenpy.lib.exception.APIException: {"errors": [{"code": "InvalidPaginationDepth", "title": "Pagination requests using Offset Pagination are limited to page 100 or up to 10000 records (page * per_page)", "detail": "There are limits to the page depth in Offset Pagination. Offset Pagination will be deprecated fully in the near future.\nPlease switch to Cursor Pagination at the earliest. Cursor Pagination does not have any limits.\nSee https://developer.zendesk.com/documentation/api-basics/pagination/comparing-cursor-pagination-and-offset-pagination\n", "source": {"parameter": "page"}, "status": "400", "links": {"related": {"title": "Pagination | Zendesk Developer Docs", "href": "https://developer.zendesk.com/api-reference/introduction/pagination"}, "announcement": {"title": "New limits for offset-based pagination | Zendesk Article", "href": "https://support.zendesk.com/hc/en-us/articles/5591904358938-New-limits-for-offset-based-pagination"}}}]}{noformat}

h2. Suggested solution(s)

Seems should use {{zenpy==2.0.46}}
[https://support.zendesk.com/hc/en-us/articles/5591904358938-New-limits-for-offset-based-pagination|https://support.zendesk.com/hc/en-us/articles/5591904358938-New-limits-for-offset-based-pagination|smart-link]

@amofakhar amofakhar merged commit 237edaf into master Sep 13, 2024
14 checks passed
@amofakhar amofakhar deleted the AP-1840_bump_pyzen branch September 13, 2024 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants