Skip to content

Commit 288c04d

Browse files
Move converter test to test_io.py
Add test_converters_partial() to test_io.py for read_excel converters
1 parent 2c1b5df commit 288c04d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/test_io.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1792,3 +1792,13 @@ def test_read_json_engine() -> None:
17921792
pd.read_json(dd, lines=False, engine="pyarrow") # type: ignore[call-overload] # pyright: ignore[reportArgumentType, reportCallIssue]
17931793
pd.read_json(io.StringIO(data), engine="pyarrow") # type: ignore[call-overload] # pyright: ignore[reportArgumentType]
17941794
pd.read_json(io.StringIO(data), lines=True, engine="pyarrow") # type: ignore[call-overload] # pyright: ignore[reportArgumentType, reportCallIssue]
1795+
1796+
1797+
def test_converters_partial() -> None:
1798+
from functools import partial
1799+
import pandas as pd
1800+
from typing_extensions import assert_type
1801+
1802+
partial_func = partial(pd.to_datetime, errors="coerce")
1803+
df = pd.read_excel("foo.xlsx", converters={"field_1": partial_func})
1804+
assert_type(df, pd.DataFrame)

0 commit comments

Comments
 (0)