fix(watermark): Return a list instead of a generator#203
Merged
Conversation
This fixes a bug in the code that expects a list instead of a Generator.
untitaker
reviewed
Sep 2, 2025
Member
untitaker
left a comment
There was a problem hiding this comment.
so why did the code typecheck if the caller expected a list and only got Iterable
Member
Author
I believe the caller is in Rust using pyo3. @bmckerry or @victoria-yining-huang could clarify specifically where this happens. |
victoria-yining-huang
approved these changes
Sep 2, 2025
Contributor
victoria-yining-huang
left a comment
There was a problem hiding this comment.
yes this works just pulled the branch and tested
Member
|
@evanh i thikn the signature of flush is also wrong |
victoria-yining-huang
added a commit
that referenced
this pull request
Sep 2, 2025
followup to [PR ](#203), the submit function needs a more specific return type, because the caller in pyo3 in rust needs a list
bmckerry
added a commit
that referenced
this pull request
Sep 4, 2025
#203 fixed the initial error by returning messages as a Sequence instead of a generator, but this caused another issue where watermarks weren't handled by the python adapter's `handle_py_return_value` function. This required implementing `From Py<PyAny> for Watermark` to allow converting the python `PyWatermark` returned from the `PythonAdapter` into a rust `PyWatermark`. A rust test for this code path is coming in a future PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes a bug in the code that expects a list instead of a Generator.