-
-
Notifications
You must be signed in to change notification settings - Fork 145
Fix #849: Update converters type in read_excel for better Pyright compatibility #1297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1792,3 +1792,13 @@ def test_read_json_engine() -> None: | |
pd.read_json(dd, lines=False, engine="pyarrow") # type: ignore[call-overload] # pyright: ignore[reportArgumentType, reportCallIssue] | ||
pd.read_json(io.StringIO(data), engine="pyarrow") # type: ignore[call-overload] # pyright: ignore[reportArgumentType] | ||
pd.read_json(io.StringIO(data), lines=True, engine="pyarrow") # type: ignore[call-overload] # pyright: ignore[reportArgumentType, reportCallIssue] | ||
|
||
|
||
def test_converters_partial() -> None: | ||
from functools import partial | ||
import pandas as pd | ||
from typing_extensions import assert_type | ||
Comment on lines
+1798
to
+1800
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. move the first import to top of file. |
||
|
||
partial_func = partial(pd.to_datetime, errors="coerce") | ||
df = pd.read_excel("foo.xlsx", converters={"field_1": partial_func}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will need to work at runtime. If you look at |
||
assert_type(df, pd.DataFrame) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use |
Uh oh!
There was an error while loading. Please reload this page.