Skip to content

Commit 16da1ba

Browse files
authored
Merge pull request #482 from opsmill/ajtm-0723205-branch-in-count
pass branch into count call
2 parents 21def0a + 7876f13 commit 16da1ba

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

changelog/+branch-in-count.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update internal calls to `count` to include the branch parameter so that the query is performed on the correct branch

infrahub_sdk/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ async def process_batch() -> tuple[list[InfrahubNode], list[InfrahubNode]]:
824824
nodes = []
825825
related_nodes = []
826826
batch_process = await self.create_batch()
827-
count = await self.count(kind=schema.kind, partial_match=partial_match, **filters)
827+
count = await self.count(kind=schema.kind, branch=branch, partial_match=partial_match, **filters)
828828
total_pages = (count + pagination_size - 1) // pagination_size
829829

830830
for page_number in range(1, total_pages + 1):
@@ -1989,7 +1989,7 @@ def process_batch() -> tuple[list[InfrahubNodeSync], list[InfrahubNodeSync]]:
19891989
related_nodes = []
19901990
batch_process = self.create_batch()
19911991

1992-
count = self.count(kind=schema.kind, partial_match=partial_match, **filters)
1992+
count = self.count(kind=schema.kind, branch=branch, partial_match=partial_match, **filters)
19931993
total_pages = (count + pagination_size - 1) // pagination_size
19941994

19951995
for page_number in range(1, total_pages + 1):

0 commit comments

Comments
 (0)