-
-
Notifications
You must be signed in to change notification settings - Fork 154
GH1317 Set defaults #1491
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?
GH1317 Set defaults #1491
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 | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -295,57 +295,57 @@ class IntervalIndex(ExtensionIndex[IntervalT, np.object_], IntervalMixin): | |||||||||
| # int gets hit first and so the correct type is returned | ||||||||||
| @overload | ||||||||||
| def interval_range( # pyright: ignore[reportOverlappingOverload] | ||||||||||
| start: int | None = ..., | ||||||||||
| end: int | None = ..., | ||||||||||
| periods: int | None = ..., | ||||||||||
| freq: int | None = ..., | ||||||||||
| name: Hashable = ..., | ||||||||||
| closed: IntervalClosedType = ..., | ||||||||||
| start: int | None = None, | ||||||||||
| end: int | None = None, | ||||||||||
| periods: int | None = None, | ||||||||||
| freq: int | None = None, | ||||||||||
| name: Hashable = None, | ||||||||||
| closed: IntervalClosedType = "right", | ||||||||||
| ) -> IntervalIndex[Interval[int]]: ... | ||||||||||
| @overload | ||||||||||
| def interval_range( | ||||||||||
| start: float | None = ..., | ||||||||||
| end: float | None = ..., | ||||||||||
| periods: int | None = ..., | ||||||||||
| freq: int | None = ..., | ||||||||||
| name: Hashable = ..., | ||||||||||
| closed: IntervalClosedType = ..., | ||||||||||
| start: float | None = None, | ||||||||||
| end: float | None = None, | ||||||||||
| periods: int | None = None, | ||||||||||
| freq: int | None = None, | ||||||||||
| name: Hashable = None, | ||||||||||
| closed: IntervalClosedType = "right", | ||||||||||
| ) -> IntervalIndex[Interval[float]]: ... | ||||||||||
| @overload | ||||||||||
| def interval_range( | ||||||||||
| start: _TimestampLike, | ||||||||||
| end: _TimestampLike | None = ..., | ||||||||||
| periods: int | None = ..., | ||||||||||
| freq: Frequency | dt.timedelta | None = ..., | ||||||||||
| name: Hashable = ..., | ||||||||||
| closed: IntervalClosedType = ..., | ||||||||||
| end: _TimestampLike | None = None, | ||||||||||
| periods: int | None = None, | ||||||||||
| freq: Frequency | dt.timedelta | None = None, | ||||||||||
| name: Hashable = None, | ||||||||||
| closed: IntervalClosedType = "right", | ||||||||||
| ) -> IntervalIndex[Interval[pd.Timestamp]]: ... | ||||||||||
| @overload | ||||||||||
| def interval_range( | ||||||||||
| *, | ||||||||||
| start: None = None, | ||||||||||
|
Comment on lines
325
to
326
Contributor
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. Can it be the following?
Suggested change
Member
Author
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. I think this overload is meant to force the user to pass |
||||||||||
| end: _TimestampLike, | ||||||||||
| periods: int | None = ..., | ||||||||||
| freq: Frequency | dt.timedelta | None = ..., | ||||||||||
| name: Hashable = ..., | ||||||||||
| closed: IntervalClosedType = ..., | ||||||||||
| periods: int | None = None, | ||||||||||
| freq: Frequency | dt.timedelta | None = None, | ||||||||||
| name: Hashable = None, | ||||||||||
| closed: IntervalClosedType = "right", | ||||||||||
| ) -> IntervalIndex[Interval[pd.Timestamp]]: ... | ||||||||||
| @overload | ||||||||||
| def interval_range( | ||||||||||
| start: _TimedeltaLike, | ||||||||||
| end: _TimedeltaLike | None = ..., | ||||||||||
| periods: int | None = ..., | ||||||||||
| freq: Frequency | dt.timedelta | None = ..., | ||||||||||
| name: Hashable = ..., | ||||||||||
| closed: IntervalClosedType = ..., | ||||||||||
| end: _TimedeltaLike | None = None, | ||||||||||
| periods: int | None = None, | ||||||||||
| freq: Frequency | dt.timedelta | None = None, | ||||||||||
| name: Hashable = None, | ||||||||||
| closed: IntervalClosedType = "right", | ||||||||||
| ) -> IntervalIndex[Interval[pd.Timedelta]]: ... | ||||||||||
| @overload | ||||||||||
| def interval_range( | ||||||||||
| *, | ||||||||||
| start: None = None, | ||||||||||
|
Comment on lines
344
to
345
Contributor
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. Can it be the following?
Suggested change
|
||||||||||
| end: _TimedeltaLike, | ||||||||||
| periods: int | None = ..., | ||||||||||
| freq: Frequency | dt.timedelta | None = ..., | ||||||||||
| name: Hashable = ..., | ||||||||||
| closed: IntervalClosedType = ..., | ||||||||||
| periods: int | None = None, | ||||||||||
| freq: Frequency | dt.timedelta | None = None, | ||||||||||
| name: Hashable = None, | ||||||||||
| closed: IntervalClosedType = "right", | ||||||||||
| ) -> IntervalIndex[Interval[pd.Timedelta]]: ... | ||||||||||
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 can verify that the changes correctly correspond to https://pandas.pydata.org/docs/dev/reference/api/pandas.interval_range.html.