Columnar export#
agensgraph.columnar. Each function imports its library only when called. See
DataFrames and Arrow.
Functions#
- agensgraph.columnar.to_arrow(
- source: Any,
- keys: Sequence[str] | None = None,
- *,
- size: int | None = None,
- oids: Sequence[int] = (),
- layout: Layout = Layout(),
- schema: Any = None,
A
pyarrow.Table.sourceis aResult, a cursor, or rows withkeys.
- agensgraph.columnar.to_pandas(
- source: Any,
- keys: Sequence[str] | None = None,
- *,
- dtypes: 'arrow' | 'numpy' = 'arrow',
- size: int | None = None,
- oids: Sequence[int] = (),
- layout: Layout = Layout(),
- schema: Any = None,
A
pandas.DataFrame, with Arrow types unlessdtypes="numpy".
- agensgraph.columnar.to_polars(
- source: Any,
- keys: Sequence[str] | None = None,
- *,
- size: int | None = None,
- oids: Sequence[int] = (),
- layout: Layout = Layout(),
- schema: Any = None,
A
polars.DataFrame.
- agensgraph.columnar.batches(
- source: Any,
- keys: Sequence[str] | None = None,
- *,
- size: int | None = 8192,
- oids: Sequence[int] = (),
- layout: Layout = Layout(),
- schema: Any = None,
pyarrow.RecordBatches ofsizerows; the first settles the schema.
- agensgraph.columnar.reader(
- source: Any,
- keys: Sequence[str] | None = None,
- *,
- size: int | None = 8192,
- oids: Sequence[int] = (),
- layout: Layout = Layout(),
- schema: Any = None,
A
pyarrow.RecordBatchReaderover the same.
- agensgraph.columnar.columns(records: Sequence[Sequence[Any]], keys: Sequence[str]) dict[str, list[Any]]#
A
dictof Python lists, without a library.
- agensgraph.columnar.async_to_arrow(
- source: Any,
- keys: Sequence[str] | None = None,
- *,
- size: int | None = None,
- oids: Sequence[int] = (),
- layout: Layout = Layout(),
- schema: Any = None,
to_arrowfor an awaiting source.
- agensgraph.columnar.async_to_pandas(
- source: Any,
- keys: Sequence[str] | None = None,
- *,
- dtypes: 'arrow' | 'numpy' = 'arrow',
- size: int | None = None,
- oids: Sequence[int] = (),
- layout: Layout = Layout(),
- schema: Any = None,
to_pandasfor an awaiting source.
Layout#
- class agensgraph.columnar.Layout(
- elements: 'struct' | 'columns' = 'struct',
- identity: 'packed' | 'text' = 'packed',
- properties: Any = 'json',
- labels: 'dictionary' | 'text' = 'dictionary',
- vectors: 'fixed' | 'list' = 'fixed',
- sparse: 'parts' | 'text' | 'dense' = 'parts',
How graph values become columns.
- elements: 'struct' | 'columns'#
struct, orcolumnsto spread an element over several
- identity: 'packed' | 'text'#
packedintegers ortext
- properties: Any#
jsontext,skip, or apyarrowstruct type of named properties
- labels: 'dictionary' | 'text'#
dictionaryencoded ortext
- vectors: 'fixed' | 'list'#
fixedsize lists or variablelists
- sparse: 'parts' | 'text' | 'dense'#
parts,textordense
- agensgraph.columnar.CHUNK = 8192#
The default chunk size.