Skip to content

Commit

Permalink
Modify get generator for yielding 1000 records (#26)
Browse files Browse the repository at this point in the history
* Added generator for the get calls

* fixed the loop terminate

* Added method for fetching inactive records

* Modified the last_updated_at arg to optional

* Modified loop terminate condition to avoid KeyError

* Modified generator to yield 1000 records at a time
  • Loading branch information
Hrishabh17 authored Mar 6, 2024
1 parent 7299c35 commit 45b5871
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions qbosdk/apis/api_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ def _query_get_all_generator(self, object_type: str, url: str) -> Generator[Dict
if not query_response or object_type not in query_response:
break

for obj in query_response[object_type]:
yield obj
yield query_response[object_type]

start_position += 1000

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

setuptools.setup(
name='qbosdk',
version='0.17.1',
version='0.17.2',
author='Shwetabh Kumar',
author_email='shwetabh.kumar@fyle.in',
description='Python SDK for accessing Quickbooks Online APIs',
Expand Down

0 comments on commit 45b5871

Please sign in to comment.