pandera.engines.engine.Engine¶
- class pandera.engines.engine.Engine(name, bases, namespace, **kwargs)[source]¶
Base Engine metaclass.
Keep a registry of concrete Engines.
Methods
- get_registered_dtypes()[source]¶
Return the
pandera.dtypes.DataType
s registered with this engine.
- register_dtype(pandera_dtype_cls=None, *, equivalents=None)[source]¶
Register a Pandera
DataType
with the engine, as class decorator.- Parameters:
Note
The classmethod
from_parametrized_dtype
will also be registered. See here for more usage details.- Example:
>>> import pandera as pa >>> >>> class MyDataType(pa.DataType): ... pass >>> >>> class MyEngine( ... metaclass=pa.engines.engine.Engine, ... base_pandera_dtypes=MyDataType, ... ): ... pass >>> >>> @MyEngine.register_dtype(equivalents=[bool]) ... class MyBool(MyDataType): ... pass
- Return type:
- __call__(*args, **kwargs)¶
Call self as a function.