Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(weave): Add generic iterator for trace server API objects #3177

Merged
merged 11 commits into from
Dec 11, 2024

Conversation

andrewtruong
Copy link
Collaborator

@andrewtruong andrewtruong commented Dec 9, 2024

Purely a refactor to make the CallsIter object more generic. This will be used in a subsequent PR to implement something like "ObjectsIter"

@circle-job-mirror
Copy link

circle-job-mirror bot commented Dec 9, 2024

TransformFunc = Callable[[T], R]


class PaginatedIterator(Generic[T, R]):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is basically a parameterized version of CallsIter

)
return response.calls

# TODO: Should be Call, not WeaveObject
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This may need to be done later. Today, we wrap the "Call" in WeaveObject to give it nice "getting" properties, but the ideal state is to just have all of the functionality on Call itself. That change is outside the scope of this PR.

@andrewtruong andrewtruong marked this pull request as ready for review December 10, 2024 16:44
@andrewtruong andrewtruong requested a review from a team as a code owner December 10, 2024 16:44
Copy link
Collaborator

@tssweeney tssweeney left a comment

Choose a reason for hiding this comment

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

Lovely refactor

@andrewtruong andrewtruong merged commit a0f1263 into master Dec 11, 2024
120 checks passed
@andrewtruong andrewtruong deleted the andrew/iterator1 branch December 11, 2024 21:56
@github-actions github-actions bot locked and limited conversation to collaborators Dec 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants