Skip to content
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

ENH: Improve general datetime functions #352

Merged
merged 15 commits into from
Oct 4, 2022
22 changes: 14 additions & 8 deletions pandas-stubs/core/indexes/datetimes.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ from datetime import (
timedelta,
tzinfo,
)
from typing import overload
from typing import (
Hashable,
Literal,
Sequence,
overload,
)

import numpy as np
from pandas import (
Expand Down Expand Up @@ -87,23 +92,24 @@ def date_range(
start: str | DatetimeLike | None = ...,
end: str | DatetimeLike | None = ...,
periods: int | None = ...,
# TODO: Test timedelta and Timedelta, update pandas docs
Copy link
Contributor

Choose a reason for hiding this comment

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

These are tested, and the docs are updated (I did them).

freq: str | timedelta | Timedelta | BaseOffset = ...,
tz: str | tzinfo = ...,
normalize: bool = ...,
name: str | None = ...,
inclusive: IntervalClosedType = ...,
**kwargs,
name: Hashable | None = ...,
inclusive: Literal["left", "right"] | None = ...,
Dr-Irv marked this conversation as resolved.
Show resolved Hide resolved
) -> DatetimeIndex: ...
def bdate_range(
start: str | DatetimeLike | None = ...,
end: str | DatetimeLike | None = ...,
periods: int | None = ...,
# TODO: Test timedelta and Timedelta, update pandas docs
freq: str | timedelta | Timedelta | BaseOffset = ...,
tz: str | tzinfo = ...,
normalize: bool = ...,
name: str | None = ...,
name: Hashable | None = ...,
weekmask: str | None = ...,
holidays: list | None = ...,
inclusive: IntervalClosedType = ...,
**kwargs,
# TODO: Check if dt.date is allowed
holidays: list[str | DatetimeLike] | None = ...,
inclusive: Literal["left", "right"] | None = ...,
Dr-Irv marked this conversation as resolved.
Show resolved Hide resolved
) -> DatetimeIndex: ...