polars.io.plugins.IOSourceScanFunction#

class polars.io.plugins.IOSourceScanFunction(*args, **kwargs)[source]#

The callable Polars invokes for a source registered with register_io_source.

This is for authors of Polars execution engines. If you are writing an IO source, you do not need it.

Polars does not call the registered source directly. It calls this wrapper, which deserializes the predicate and forwards the call. An engine holding the scan function of a PythonScan node can use this protocol to identify the sources it knows about.

Warning

This functionality is considered unstable. It may be changed at any point without it being considered a breaking change.

Examples

>>> # `scan_fn` is the scan function of the `PythonScan` node being executed.
>>> if isinstance(scan_fn, IOSourceScanFunction):  
...     source = scan_fn.io_source
__init__(*args, **kwargs)[source]#

Methods

__init__(*args, **kwargs)

Attributes

io_source

The source that was passed to register_io_source().