-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
TYP: simplify read_csv/fwf/table overloads #57476
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
Conversation
keep_default_na: bool = True, | ||
na_filter: bool = True, | ||
verbose: bool | lib.NoDefault = lib.no_default, | ||
skip_blank_lines: bool = True, | ||
# Datetime Handling | ||
parse_dates: bool | Sequence[Hashable] = False, | ||
parse_dates: bool | Sequence[Hashable] | None = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what to do here: None of the three methods document None
but it is the default in read_csv
.
A few options:
- Document it, but keep it
False
inread_table
(and add a deprecation warning, that it will be None in the future) - Document it, change it to
None
inread_table
(might need a deprecationwarnign first? edit: could probably directly change it with 3.0 but add a whatsnew entry?) - Disallow
None
, add a deprecation warning in the other methods
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Document it, change it to None in read_table (might need a deprecationwarnign first? edit: could probably directly change it with 3.0 but add a whatsnew entry?)
I would support this and mark it as an Other API changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, the current commits already do that :)
"infer_nrows": infer_nrows, | ||
"engine": "python-fwf", | ||
"iterator": iterator, | ||
"chunksize": chunksize, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mypy doesn't like assigning new fields to a TypedDict
@@ -478,6 +479,59 @@ class _Fwf_Defaults(TypedDict): | |||
widths: None | |||
|
|||
|
|||
class _read_shared(TypedDict, total=False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure whether this should move to _typing
?
@@ -1488,17 +1163,6 @@ def read_fwf( | |||
infer_nrows : int, default 100 | |||
The number of rows to consider when letting the parser determine the | |||
`colspecs`. | |||
dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did this get moved somewhere else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved it into the kwds
to share it among the read-functions. The doc-test was failing as it did not find the corresponding keyword in the function signature anymore.
Thanks @twoertwein |
* TYP: simplify read_csv/fwf/table overloads * isort (keep thinking ruff is configured to do that too) * another one * fix docs? * sort whatsnew entry
No description provided.