MCPcopy Create free account
hub / github.com/apache/arrow / do_put

Method do_put

python/pyarrow/tests/test_flight.py:189–204  ·  view source on GitHub ↗
(self, context, descriptor, reader, writer)

Source from the content-addressed store, hash-verified

187 options=self.options)
188
189 def do_put(self, context, descriptor, reader, writer):
190 counter = 0
191 expected_data = [-10, -5, 0, 5, 10]
192 assert reader.stats.num_messages == 1
193 for batch, buf in reader:
194 assert batch.equals(pa.RecordBatch.from_arrays(
195 [pa.array([expected_data[counter]])],
196 ['a']
197 ))
198 assert buf is not None
199 client_counter, = struct.unpack('<i', buf.to_pybytes())
200 assert counter == client_counter
201 writer.write(struct.pack('<i', counter))
202 counter += 1
203 assert reader.stats.num_messages == 6
204 assert reader.stats.num_record_batches == 5
205
206 @staticmethod
207 def number_batches(table):

Callers

nothing calls this directly

Calls 5

equalsMethod · 0.80
arrayMethod · 0.45
unpackMethod · 0.45
writeMethod · 0.45
packMethod · 0.45

Tested by

no test coverage detected