Example #1
0
 def _decode_one_batch_from_stream(self,
                                   in_stream: create_InputStream) -> List:
     self._resettable_io.set_input_bytes(in_stream.read_all(True))
     # there is only one arrow batch in the underlying input stream
     table = pa.Table.from_batches([next(self._batch_reader)])
     return [
         ArrowCoderImpl.tz_convert_from_internal(
             c.to_pandas(date_as_object=True), t, self._timezone)
         for c, t in zip(table.itercolumns(), self._field_types)
     ]
Example #2
0
 def _decode_one_batch_from_stream(self, in_stream: create_InputStream,
                                   size: int) -> List:
     self._resettable_io.set_input_bytes(in_stream.read(size))
     # there is only one arrow batch in the underlying input stream
     return arrow_to_pandas(self._timezone, self._field_types,
                            [next(self._batch_reader)])
Example #3
0
 def _decode_one_batch_from_stream(self,
                                   in_stream: create_InputStream) -> List:
     self._resettable_io.set_input_bytes(in_stream.read_all(True))
     # there is only one arrow batch in the underlying input stream
     table = pa.Table.from_batches([next(self._batch_reader)])
     return [c.to_pandas(date_as_object=True) for c in table.itercolumns()]
Example #4
0
 def decode_from_stream(self, in_stream: create_InputStream, nested):
     data_input_stream = InputStream(in_stream.read_all(False))
     return self._value_coder.decode_from_stream(data_input_stream)