Skip to content

Commit

Permalink
feat(pandas): support memtable in pandas backend
Browse files Browse the repository at this point in the history
Closes #5467
  • Loading branch information
anjakefala authored and cpcloud committed Apr 6, 2023
1 parent 4a957fd commit 6e4d621
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions ibis/backends/pandas/execution/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1442,6 +1442,11 @@ def execute_zero_if_null_series(op, data, **kwargs):
return data.replace({np.nan: zero, None: zero, pd.NA: zero})


@execute_node.register(ops.InMemoryTable)
def execute_in_memory_table(op, **kwargs):
return op.data.to_frame()


@execute_node.register(
ops.ZeroIfNull,
(type(None), type(pd.NA), numbers.Real, np.integer, np.floating),
Expand Down
4 changes: 2 additions & 2 deletions ibis/backends/tests/test_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ def test_literal_na(con, dtype):


@pytest.mark.notimpl(["datafusion"], raises=com.OperationNotDefinedError)
@pytest.mark.notimpl(["dask", "pandas"], raises=com.UnboundExpressionError)
@pytest.mark.notimpl(["dask"], raises=com.UnboundExpressionError)
def test_memtable_bool_column(backend, con, monkeypatch):
monkeypatch.setattr(ibis.options, "default_backend", con)

Expand All @@ -925,7 +925,7 @@ def test_memtable_bool_column(backend, con, monkeypatch):


@pytest.mark.notimpl(["datafusion"], raises=com.OperationNotDefinedError)
@pytest.mark.notimpl(["dask", "pandas"], raises=com.UnboundExpressionError)
@pytest.mark.notimpl(["dask"], raises=com.UnboundExpressionError)
@pytest.mark.broken(
["druid"],
raises=AssertionError,
Expand Down

0 comments on commit 6e4d621

Please sign in to comment.