Skip to content

Conversation

tsubakiky
Copy link
Collaborator

@tsubakiky tsubakiky commented Jul 8, 2025

This pull request refines the handling of asynchronous streams in the src/connect/content_stream.py file. Key changes include improvements to error handling, ensuring streams are properly closed, and allowing streams to be nullable. These updates enhance robustness and maintainability.

Enhancements to error handling:

  • Updated exception handling in __aiter__ methods of both BoundAsyncStream and AsyncDataStream to raise an ExceptionGroup when multiple errors occur during stream closure. This ensures better visibility of compound errors. [1] [2]

Stream lifecycle management:

  • Modified aclose methods in both BoundAsyncStream and AsyncDataStream to set _stream and _aclose_func to None after closing, ensuring proper cleanup of resources. [1] [2]

Nullable streams:

  • Changed _stream attributes in both BoundAsyncStream and AsyncDataStream to allow None values, enabling safer handling of streams that may not be initialized. [1] [2]

@tsubakiky tsubakiky requested a review from zchee as a code owner July 8, 2025 03:10
@zchee
Copy link
Member

zchee commented Jul 8, 2025

@tsubakiky PR description? bug fix? or new feature?

@zchee
Copy link
Member

zchee commented Jul 8, 2025

@tsubakiky client conformance test failed

@zchee zchee added the bug Something isn't working label Jul 8, 2025
Copy link
Member

@zchee zchee left a comment

Choose a reason for hiding this comment

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

SGTM

@tsubakiky
Copy link
Collaborator Author

@tsubakiky PR description? bug fix? or new feature?

bug fix

@zchee
Copy link
Member

zchee commented Jul 8, 2025

@tsubakiky labeled

@tsubakiky tsubakiky merged commit ec02c86 into main Jul 8, 2025
5 of 6 checks passed
@tsubakiky tsubakiky deleted the content-stream-resorce-flash branch July 8, 2025 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants