File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,10 @@ async def _on_chunk_update(self, chunk: proto_DataStream.Chunk):
7070 await self ._queue .put (chunk )
7171
7272 async def _on_stream_close (self , trailer : proto_DataStream .Trailer ):
73- self .info .attributes .update (trailer .attributes )
73+ if self .info .attributes is None :
74+ self .info .attributes = dict (trailer .attributes )
75+ else :
76+ self .info .attributes .update (trailer .attributes )
7477 await self ._queue .put (None )
7578
7679 def __aiter__ (self ) -> AsyncIterator [str ]:
@@ -119,6 +122,10 @@ async def _on_chunk_update(self, chunk: proto_DataStream.Chunk):
119122 await self ._queue .put (chunk )
120123
121124 async def _on_stream_close (self , trailer : proto_DataStream .Trailer ):
125+ if self .info .attributes is None :
126+ self .info .attributes = dict (trailer .attributes )
127+ else :
128+ self .info .attributes .update (trailer .attributes )
122129 await self ._queue .put (None )
123130
124131 def __aiter__ (self ) -> AsyncIterator [bytes ]:
You can’t perform that action at this time.
0 commit comments