Skip to content

Commit

Permalink
test: move to right place
Browse files Browse the repository at this point in the history
  • Loading branch information
PrettyWood committed Jul 19, 2024
1 parent a0e7425 commit eff563d
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 10 deletions.
Binary file modified python/tests/fixtures/fixture-multi-dtypes-columns.xlsx
Binary file not shown.
Binary file removed python/tests/fixtures/sheet-bool.xlsx
Binary file not shown.
2 changes: 2 additions & 0 deletions python/tests/test_dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def expected_data() -> dict[str, list[Any]]:
"Details": ["Healthcare"] * 7 + ["Something"] * 2,
"Asset ID": ["84444"] * 7 + ["ABC123"] * 2,
"Mixed dates": ["2023-07-21 00:00:00"] * 6 + ["July 23rd"] * 3,
"Mixed bools": ["true"] * 5 + ["false"] * 3 + ["other"],
}


Expand Down Expand Up @@ -92,6 +93,7 @@ def test_sheet_with_mixed_dtypes_and_sample_rows(expected_data: dict[str, list[A
]
expected_data["Asset ID"] = [84444.0] * 7 + [None] * 2
expected_data["Mixed dates"] = [datetime(2023, 7, 21)] * 6 + [None] * 3
expected_data["Mixed bools"] = [True] * 5 + [False] * 3 + [None]

pd_df = sheet.to_pandas()
pd_assert_frame_equal(
Expand Down
10 changes: 0 additions & 10 deletions python/tests/test_fastexcel.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,13 +580,3 @@ def test_null_values_in_cells() -> None:
pd_expected = pd.DataFrame(expected)
pd_expected["Date"] = pd_expected["Date"].dt.as_unit("ms")
pd_assert_frame_equal(sheet.to_pandas(), pd_expected)


def test_bool_casting_to_string() -> None:
excel_reader = fastexcel.read_excel(path_for_fixture("sheet-bool.xlsx"))
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))
pd_assert_frame_equal(sheet.to_pandas(), pd.DataFrame(expected))

0 comments on commit eff563d

Please sign in to comment.