Sources#
These constructors return frozen handles for moruna.run(source=...). They have no public data methods.
moruna.ParquetSource#
moruna.ParquetSource(urls, *, columns=None, filters=None)
Parameter |
Type and default |
Meaning |
|---|---|---|
|
|
Parquet path, prefix, URL, or a nonempty sequence. |
|
|
Columns to read. |
|
|
Row-group predicates |
moruna.VortexSource#
moruna.VortexSource(urls, *, columns=None, split_bytes=None)
urls is a path, prefix, URL, or nonempty sequence of them. columns: list[str] | None projects columns. split_bytes: int | None sets target split size; it must be positive and defaults to about 128 MiB.
moruna.TensorSource#
moruna.TensorSource(paths, *, tensors=None)
paths is one safetensors/aligned-binary path or a nonempty sequence. tensors: list[str] | None selects tensor names; None reads all.
moruna.IteratorSource#
moruna.IteratorSource(iterable, *, schema)
iterable yields pyarrow.RecordBatch objects and is converted to an iterator at construction. Required schema is a pyarrow.Schema for tables or (dtype: str, shape: sequence[int]) for tensors. An iterator source cannot be resumed or read by row position; use a custom source for that.
moruna.Split#
moruna.Split(id: int, rows: int, bytes: int | None = None)
Frozen descriptor returned by Source.plan(). Read-only id is a unique unsigned 32-bit integer; rows is the exact unsigned 64-bit count; bytes is an optional estimated size in Arrow form. Invalid or negative values raise ValueError.
moruna.Source#
class MySource(moruna.Source):
repeatable = True
def plan(self) -> list[moruna.Split]: ...
def read(self, split_id: int, start: int, end: int) -> pyarrow.RecordBatch: ...
def schema(self) -> pyarrow.Schema | None: ...
Member |
Required |
Contract |
|---|---|---|
|
Yes |
Called once. Return splits with unique ids and exact row counts. |
|
Yes |
Return exactly |
|
No |
Base returns |
|
No |
Class attribute, default |