-
-
Notifications
You must be signed in to change notification settings - Fork 151
GH1264 Version 2.0 cleanup #1265
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
Changes from 1 commit
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 |
|---|---|---|
|
|
@@ -2324,6 +2324,13 @@ class TimedeltaSeries(Series[Timedelta]): | |
| *args: Any, | ||
| **kwargs: Any, | ||
| ) -> TimedeltaSeries: ... | ||
| def cumprod( | ||
| self, | ||
| axis: AxisIndex | None = ..., | ||
|
||
| skipna: _bool = ..., | ||
| *args: Any, | ||
| **kwargs: Any, | ||
| ) -> Never: ... | ||
|
|
||
| class PeriodSeries(Series[Period]): | ||
| @property | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -172,6 +172,10 @@ def test_difference_none() -> None: | |
| # GH 253 | ||
| check(assert_type(ind.difference([1]), "pd.Index[int]"), pd.Index) | ||
|
|
||
| # check with sort parameter | ||
| check(assert_type(ind.difference([1, None], sort=False), "pd.Index[int]"), pd.Index) | ||
| check(assert_type(ind.difference([1], sort=True), "pd.Index[int]"), pd.Index) | ||
|
|
||
|
|
||
| def test_str_split() -> None: | ||
| # GH 194 | ||
|
|
@@ -312,6 +316,20 @@ def test_range_index_union(): | |
| ), | ||
| pd.Index, | ||
| ) | ||
| check( | ||
| assert_type( | ||
| pd.RangeIndex(0, 10).union(["a", "b", "c"], sort=True), | ||
| Union[pd.Index, "pd.Index[int]", pd.RangeIndex], | ||
| ), | ||
| pd.Index, | ||
| ) | ||
| check( | ||
| assert_type( | ||
| pd.RangeIndex(0, 10).union(["a", "b", "c"], sort=False), | ||
| Union[pd.Index, "pd.Index[int]", pd.RangeIndex], | ||
| ), | ||
|
||
| pd.Index, | ||
| ) | ||
|
|
||
|
|
||
| def test_range_index_start_stop_step(): | ||
|
|
@@ -1361,3 +1379,10 @@ def test_index_dict() -> None: | |
| ), | ||
| pd.TimedeltaIndex, | ||
| ) | ||
|
|
||
|
|
||
| def test_index_infer_objects() -> None: | ||
| """Test infer_objects method on Index.""" | ||
| df = pd.DataFrame({"A": ["a", 1, 2, 3]}) | ||
| idx = df.set_index("A").index[1:] | ||
| check(assert_type(idx.infer_objects(), pd.Index), pd.Index) | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -3941,3 +3941,8 @@ def test_series_index_type() -> None: | |||||
|
|
||||||
| if TYPE_CHECKING_INVALID_USAGE: | ||||||
| t = pd.Series([1, 2], index="ab") # type: ignore[call-overload] # pyright: ignore[reportCallIssue, reportArgumentType] | ||||||
|
|
||||||
|
|
||||||
| def test_timedelta_index_cumsum() -> None: | ||||||
|
||||||
| def test_timedelta_index_cumsum() -> None: | |
| def test_timedelta_invalid_cumprod() -> 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.
Might as well be consistent with these different operations