Skip to content

Commit

Permalink
test: add test cases for no-op fillna expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrist committed May 7, 2024
1 parent 378251e commit c2e67a4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ibis/backends/tests/test_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ def test_table_fillna_invalid(alltypes):
param({"int_col": 20}, id="int"),
param({"double_col": -1, "string_col": "missing"}, id="double-int-str"),
param({"double_col": -1.5, "string_col": "missing"}, id="double-str"),
param({}, id="empty"),
],
)
def test_table_fillna_mapping(backend, alltypes, replacements):
Expand Down Expand Up @@ -497,6 +498,17 @@ def test_table_fillna_scalar(backend, alltypes):
backend.assert_frame_equal(res, sol, check_dtype=False)


def test_table_fillna_scalar_no_nullable_columns(backend, alltypes):
table = alltypes.select("int_col", "double_col").cast(
{"int_col": "!int64", "double_col": "!float64"}
)
pd_table = table.execute()

res = table.fillna(0).execute().reset_index(drop=True)
sol = pd_table.fillna(0).reset_index(drop=True)
backend.assert_frame_equal(res, sol, check_dtype=False)


def test_mutate_rename(alltypes):
table = alltypes.select(["bool_col", "string_col"])
table = table.mutate(dupe_col=table["bool_col"])
Expand Down

0 comments on commit c2e67a4

Please sign in to comment.