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

Method do_put

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

Source from the content-addressed store, hash-verified

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