-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix: Pass cursor parameter to server #745
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
fix: Pass cursor parameter to server #745
Conversation
class PaginatedRequest(Request[RequestParamsT, MethodT]): | ||
cursor: Cursor | None = None | ||
""" | ||
An opaque token representing the current pagination position. | ||
If provided, the server should return results starting after this cursor. | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed this, since it was only used for the methods in question.
@pytest.fixture | ||
def stream_spy(): | ||
"""Fixture that provides spies for both client and server write streams. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Built this as a fixture so that it can be easily reused in multiple tests.
I needed a way to verify the request payload "on the wire" and this seemed like a good approach, since it did not require any modification of the actual client code (only test fixtures).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for the fix!
Would be great to keep types consistent with the spec
once that done, ready to merge
Thanks for the guidance @ihrpr! I've pushed these changes:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much @nbarbettini for the quick turnaround.
I think we can remove params: PaginatedRequestParams | None = None
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you soo much!
No problem, happy to help! |
Motivation and Context
Fixes #735 by:
See also: PR comments inline
I'm happy to update the approach if it doesn't fit the style of this repo.
How Has This Been Tested?
Breaking Changes
None - internal changes only, no client interface changes.
Types of changes
Checklist