Skip to content

Conversation

@twoertwein
Copy link
Member

No description provided.

skip_blank_lines: bool = True,
# Datetime Handling
parse_dates: bool | Sequence[Hashable] = False,
parse_dates: bool | Sequence[Hashable] | None = None,
Copy link
Member Author

@twoertwein twoertwein Feb 17, 2024

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 in read_table (and add a deprecation warning, that it will be None in the future)
  • 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?)
  • Disallow None, add a deprecation warning in the other methods
Copy link
Member

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

Copy link
Member Author

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,
Copy link
Member Author

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

widths: None


class _read_shared(TypedDict, total=False):
Copy link
Member Author

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?

@twoertwein twoertwein marked this pull request as ready for review February 18, 2024 02:09
@twoertwein twoertwein requested a review from Dr-Irv as a code owner February 18, 2024 02:09
@mroeschke mroeschke added the Typing type annotations, mypy/pyright type checking label Feb 19, 2024
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'
Copy link
Member

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?

Copy link
Member Author

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.

@mroeschke mroeschke added this to the 3.0 milestone Feb 21, 2024
@mroeschke mroeschke merged commit 5870057 into pandas-dev:main Feb 21, 2024
@mroeschke
Copy link
Member

Thanks @twoertwein

@twoertwein twoertwein deleted the read_overloads branch April 7, 2024 10:59
pmhatre1 pushed a commit to pmhatre1/pandas-pmhatre1 that referenced this pull request May 7, 2024
* TYP: simplify read_csv/fwf/table overloads * isort (keep thinking ruff is configured to do that too) * another one * fix docs? * sort whatsnew entry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Typing type annotations, mypy/pyright type checking

2 participants