Skip to content

Conversation

@minitriga
Copy link
Contributor

Resolves: #159

@minitriga minitriga self-assigned this Jan 6, 2025
@codecov
Copy link

codecov bot commented Jan 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

@@             Coverage Diff             @@
##           develop     #219      +/-   ##
===========================================
+ Coverage    68.03%   68.21%   +0.17%     
===========================================
  Files           82       82              
  Lines         7384     7424      +40     
  Branches      1442     1446       +4     
===========================================
+ Hits          5024     5064      +40     
  Misses        1986     1986              
  Partials       374      374              
Flag Coverage Δ
integration-tests 13.02% <29.85%> (+0.03%) ⬆️
python-3.10 43.60% <100.00%> (+0.30%) ⬆️
python-3.11 43.60% <100.00%> (+0.30%) ⬆️
python-3.12 43.60% <100.00%> (+0.30%) ⬆️
python-3.13 43.60% <100.00%> (+0.30%) ⬆️
python-3.9 42.03% <98.50%> (+0.30%) ⬆️
python-filler-3.12 23.92% <0.00%> (-0.13%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
infrahub_sdk/client.py 65.76% <100.00%> (+1.69%) ⬆️

@minitriga minitriga marked this pull request as draft January 7, 2025 17:16
@minitriga minitriga changed the title WIP: resolves #159: Add batch argument to fetch data in batches resolves #159: Add batch argument to fetch data in batches Jan 7, 2025
@minitriga minitriga requested a review from dgarros January 7, 2025 17:24
@minitriga minitriga marked this pull request as ready for review January 7, 2025 17:24
Copy link
Contributor

@dgarros dgarros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall

nodes = []
related_nodes = []
batch_process = await self.create_batch()
resp = await self.execute_graphql(query=f"query {{ {schema_kind} {{ count }} }}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to move this into a dedicated count method, there's already an issue to track that #158

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like @gmazoyer is already on it #225

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have now moved it over to using client.count().

prefetch_relationships: bool = ...,
partial_match: bool = ...,
property: bool = ...,
batch: bool = ...,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking out loud
I'm not sure if batch will be clear enough for the end user ?
As an alternative we could use parallel
any preference @opsmill/customer-success ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have renamed to parallel for now.

@dgarros dgarros merged commit dfd2816 into develop Jan 9, 2025
14 checks passed
@dgarros dgarros deleted the atg-20250106-ihs-71 branch January 9, 2025 05:10
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.

feature: provide a way to use pagination concurrently to retrieve objects using the SDK

3 participants