diff --git a/ibis/backends/pandas/execution/generic.py b/ibis/backends/pandas/execution/generic.py index e23ecdd1aa8e..2e30dd33c6b4 100644 --- a/ibis/backends/pandas/execution/generic.py +++ b/ibis/backends/pandas/execution/generic.py @@ -1450,3 +1450,8 @@ def execute_table_array_view(op, _, **kwargs): @execute_node.register(ops.InMemoryTable) def execute_in_memory_table(op, **kwargs): return op.data.to_frame() + + +@execute_node.register(ops.Sample, pd.DataFrame, object, object) +def execute_sample(op, data, fraction, seed, **kwargs): + return data.sample(frac=fraction, random_state=seed) diff --git a/ibis/backends/tests/test_generic.py b/ibis/backends/tests/test_generic.py index d76cefaafa1a..aa327a20677c 100644 --- a/ibis/backends/tests/test_generic.py +++ b/ibis/backends/tests/test_generic.py @@ -1537,7 +1537,6 @@ def test_dynamic_table_slice_with_computed_offset(backend): "druid", "flink", "impala", - "pandas", "polars", "pyspark", "snowflake", @@ -1566,7 +1565,6 @@ def test_sample(backend): "druid", "flink", "impala", - "pandas", "polars", "pyspark", "snowflake", @@ -1591,7 +1589,6 @@ def test_sample_memtable(con, backend): "mssql", "mysql", "oracle", - "pandas", "polars", "postgres", "pyspark",