pandera.engines.polars_engine.ArrayΒΆ

class pandera.engines.polars_engine.Array(inner: Literal[None] = ..., shape: Literal[None] = ..., *, width: Literal[None] = ...)[source]ΒΆ
class pandera.engines.polars_engine.Array(inner: DataTypeClass | DataType = ..., shape: int | Tuple[int, ...] | None = ..., *, width: int | None = ...)

Polars Array nested type.

Attributes

auto_coerce

Whether to force coerce to be True in all cases

continuous

Whether the number data type is continuous.

Methods

__init__(inner: Literal[None] = None, shape: Literal[None] = None, *, width: Literal[None] = None) None[source]ΒΆ
__init__(inner: DataTypeClass | DataType = None, shape: int | Tuple[int, ...] | None = None, *, width: int | None = None) None
check(pandera_dtype, data_container=None)[source]ΒΆ

Check that pandera DataType are equivalent.

Parameters:
  • pandera_dtype (DataType) – Expected DataType.

  • data_container (Union[LazyFrame, PolarsData, None]) – Data container, used by data types that require the actual data for validation.

Return type:

Union[bool, Iterable[bool]]

Returns:

boolean scalar or iterable of boolean scalars, indicating which elements passed the check.

coerce(data_container)[source]ΒΆ

Coerce data container to the data type.

Return type:

LazyFrame

coerce_value(value)[source]ΒΆ

Coerce an value to a particular type.

classmethod from_parametrized_dtype(polars_dtype)[source]ΒΆ
try_coerce(data_container)[source]ΒΆ

Coerce data container to the data type, raises a ParserError if the coercion fails :raises: ParserError: if coercion fails

Return type:

LazyFrame

__call__(data_container)[source]ΒΆ

Coerce data container to the data type.