fugue_ibis.execution#
fugue_ibis.execution.ibis_engine#
- class fugue_ibis.execution.ibis_engine.IbisEngine(execution_engine)[source]#
Bases:
EngineFacet
The abstract base class for different ibis execution implementations.
- Parameters
execution_engine (ExecutionEngine) – the execution engine this ibis engine will run on
- property is_distributed: bool#
Whether this engine is a distributed engine
- abstract select(dfs, ibis_func)[source]#
Execute the ibis select expression.
- Parameters
dfs (DataFrames) – a collection of dataframes that must have keys
ibis_func (Callable[[BaseBackend], TableExpr]) – the ibis compute function
- Returns
result of the ibis function
- Return type
Note
This interface is experimental, so it is subjected to change.
- to_df(df, schema=None)[source]#
Convert a data structure to this engine compatible DataFrame
- Parameters
data –
DataFrame
, pandas DataFramme or list or iterable of arrays or others that is supported by certain engine implementationschema (Optional[Any]) – Schema like object, defaults to None
df (AnyDataFrame) –
- Returns
engine compatible dataframe
- Return type
Note
There are certain conventions to follow for a new implementation:
if the input is already in compatible dataframe type, it should return itself
all other methods in the engine interface should take arbitrary dataframes and call this method to convert before doing anything
fugue_ibis.execution.pandas_backend#
- class fugue_ibis.execution.pandas_backend.PandasIbisEngine(execution_engine)[source]#
Bases:
IbisEngine
- Parameters
execution_engine (ExecutionEngine) –
- select(dfs, ibis_func)[source]#
Execute the ibis select expression.
- Parameters
dfs (DataFrames) – a collection of dataframes that must have keys
ibis_func (Callable[[BaseBackend], TableExpr]) – the ibis compute function
- Returns
result of the ibis function
- Return type
Note
This interface is experimental, so it is subjected to change.