Skip to content

Commit

Permalink
Merge pull request #6 from austinhallett/bugfix/override-links
Browse files Browse the repository at this point in the history
update nested dict for linked objects
  • Loading branch information
austinhallett authored Jan 31, 2024
2 parents fd8b61d + fe12979 commit 08eac5d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI

on: push
on:
push:
tags:
- "*"

jobs:
build:
Expand Down
10 changes: 8 additions & 2 deletions py_jama_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,19 @@ def get_all(
total_results = float("inf")

data, meta, links, linked = [], {}, {}, {}

while len(data) < total_results:
page = self.get_page(resource, start_index, params=params, **kwargs)

meta.update(page.meta)
links.update(page.links)
linked.update(page.linked)

for item_type_key in page.linked:
if item_type_key not in linked:
linked[item_type_key] = {}
linked[item_type_key] = {
**linked[item_type_key],
**page.linked[item_type_key],
}

page_info = page.meta.get("pageInfo")
start_index = page_info.get("startIndex") + allowed_results_per_page
Expand Down

0 comments on commit 08eac5d

Please sign in to comment.