Skip to content

Commit

Permalink
Remove order query param from manual_journals request (#104)
Browse files Browse the repository at this point in the history
* Remove `order` query param from manual_journals request

* Disable `consider-using-generator` pylint warning

* Bump to v2.2.3
  • Loading branch information
bryantgray authored Dec 30, 2022
1 parent 35e21ef commit 16dd78c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 2.2.3
* Adds a workaround for a Xero bug to allow pagination to function properly in the `manual_journals` stream [#104](https://github.com/singer-io/tap-xero/pull/104)

## 2.2.2
* Changes the endpoint used for check_platform_access from `Contacts` to `Currencies` [#98](https://github.com/singer-io/tap-xero/pull/98)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from setuptools import setup, find_packages

setup(name="tap-xero",
version="2.2.2",
version="2.2.3",
description="Singer.io tap for extracting data from the Xero API",
author="Stitch",
url="http://singer.io",
Expand Down
10 changes: 8 additions & 2 deletions tap_xero/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def sync(self, ctx):
if records:
self.format_fn(records)
self.write_records(records, ctx)
max_bookmark_value = max([record[self.bookmark_key] for record in records])
max_bookmark_value = max([record[self.bookmark_key] for record in records]) # pylint: disable=consider-using-generator
ctx.set_bookmark(bookmark, max_bookmark_value)
ctx.write_state()

Expand All @@ -93,7 +93,13 @@ def sync(self, ctx):
start = ctx.update_start_date_bookmark(bookmark)
curr_page_num = ctx.get_offset(offset) or 1

self.filter_options.update(dict(since=start, order="UpdatedDateUTC ASC"))
self.filter_options.update({"since": start})

# Xero bug causes all manual_journal records to be returned instead of
# 100 per page when `order` is specified. `UpdatedDateUTC ASC` is the
# default so we can safely exclude it until the bug is fixed.
if self.tap_stream_id != "manual_journals":
self.filter_options.update({"order": "UpdatedDateUTC ASC"})

max_updated = start
while True:
Expand Down

0 comments on commit 16dd78c

Please sign in to comment.