Skip to content

Commit

Permalink
test: rewrite a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
PrettyWood committed Jul 17, 2024
1 parent b2ee363 commit 82e3e2a
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions python/tests/test_fastexcel.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,12 +584,13 @@ def test_null_values_in_cells() -> None:

def test_bool_casting_to_string_for_polars() -> None:
excel_reader = fastexcel.read_excel(path_for_fixture("sheet-bool.xlsx"))

actual_polars_df = excel_reader.load_sheet(0, header_row=None, column_names=["0"]).to_polars()
expected_polars_df = pl.DataFrame(
{
"0": ["true", "false", "some string"],
}
sheet = excel_reader.load_sheet(0, column_names=["col1"])
expected = {
"col1": ["true", "false", "some string"],
}
pl_assert_frame_equal(
sheet.to_polars(),
pl.DataFrame(expected),
)

pl_assert_frame_equal(actual_polars_df, expected_polars_df)
pd_expected = pd.DataFrame(expected)
pd_assert_frame_equal(sheet.to_pandas(), pd_expected)

0 comments on commit 82e3e2a

Please sign in to comment.