Skip to content

Typing: Narrow down types of arguments (NDFrame) #10 #52754

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

Merged
merged 16 commits into from
Apr 25, 2023
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2276,7 +2276,7 @@ def to_json(
date_format: str | None = None,
double_precision: int = 10,
force_ascii: bool_t = True,
date_unit: str = "ms",
date_unit: Literal["s", "ms", "us", "ns"] = "ms",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one seems broadly useful - perhaps let's define it as TimeUnit in _typing.py and import it here?

default_handler: Callable[[Any], JSONSerializable] | None = None,
lines: bool_t = False,
compression: CompressionOptions = "infer",
Expand Down Expand Up @@ -2556,11 +2556,11 @@ def to_hdf(
self,
path_or_buf: FilePath | HDFStore,
key: str,
mode: str = "a",
mode: Literal["a", "w", "r+"] = "a",
complevel: int | None = None,
complib: str | None = None,
complib: ["zlib", "lzo", "bzip2", "blosc"] | None = None,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing literal

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change addressed problems

append: bool_t = False,
format: str | None = None,
format: Literal["fixed", "table"] | None = None,
index: bool_t = True,
min_itemsize: int | dict[str, int] | None = None,
nan_rep=None,
Expand Down