lenskit.data.matrix.SparseIndexListType#

class lenskit.data.matrix.SparseIndexListType(dimension, large=False)#

Bases: pyarrow.ExtensionType

Sparse index lists. These are the row type for structure-only sparse matrices.

Parameters:
value_type: None = None#
index_type: SparseIndexType#
classmethod from_type(data_type, dimension=None)#

Create a sparse index list type from an Arrow data type, handling legacy struct layouts without the extension types.

Parameters:
  • data_type (pyarrow.DataType) – The Arrow data type to interpret as a row type.

  • dimension (int | None) – The row dimension, if known from an external source. If provided and the data type also includes the dimensionality, both dimensions must match.

Raises:
  • TypeError – If the data type is not a valid sparse row type.

  • ValueError – If there is another error, such as mismatched dimensions.

Return type:

SparseIndexListType

property dimension: int#
Return type:

int

__arrow_ext_serialize__()#
Return type:

bytes

classmethod __arrow_ext_deserialize__(storage_type, serialized)#
__arrow_ext_class__()#