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

Function datasource1_direct

python/pyarrow/tests/test_udf.py:679–694  ·  view source on GitHub ↗

A short dataset

()

Source from the content-addressed store, hash-verified

677
678
679def datasource1_direct():
680 """A short dataset"""
681 schema = datasource1_schema()
682
683 class Generator:
684 def __init__(self):
685 self.n = 3
686
687 def __call__(self, ctx):
688 if self.n == 0:
689 batch = _record_batch_from_iters(schema, [], [])
690 else:
691 self.n -= 1
692 batch = _record_batch_for_range(schema, self.n)
693 return batch.to_struct_array()
694 return lambda ctx: Generator()
695
696
697def datasource1_generator():

Callers

nothing calls this directly

Calls 2

datasource1_schemaFunction · 0.85
GeneratorClass · 0.70

Tested by

no test coverage detected