Skip to content

refactor: #718 only drop TimestampSeries #1274

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

cmp0xff
Copy link
Contributor

@cmp0xff cmp0xff commented Jul 13, 2025

  • Closes #xxxx (Replace xxxx with the Github issue number)
  • Tests added: Please use assert_type() to assert the type of any return value

@cmp0xff cmp0xff marked this pull request as ready for review July 13, 2025 07:05
@cmp0xff cmp0xff changed the title fix: #718 only drop TimestampSeries refactor: #718 only drop TimestampSeries Jul 13, 2025
Comment on lines +624 to +643
check(
assert_type(s5.dt.as_unit("s"), "pd.Series[pd.Timedelta]"), # type: ignore[assert-type]
pd.Series,
pd.Timedelta,
)
check(
assert_type(s5.dt.as_unit("ms"), "pd.Series[pd.Timedelta]"), # type: ignore[assert-type]
pd.Series,
pd.Timedelta,
)
check(
assert_type(s5.dt.as_unit("us"), "pd.Series[pd.Timedelta]"), # type: ignore[assert-type]
pd.Series,
pd.Timedelta,
)
check(
assert_type(s5.dt.as_unit("ns"), "pd.Series[pd.Timedelta]"), # type: ignore[assert-type]
pd.Series,
pd.Timedelta,
)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These type: ignores will be removed in #1273

Comment on lines 1756 to 1759
@overload
def __sub__(
self, other: Timestamp | datetime | TimestampSeries
self, other: Timestamp | datetime | Series[Timestamp]
) -> TimedeltaSeries: ...
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Disabling mypy from recognising ss = s1 - s2 in test_series_min_max_sub_axis

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comment on lines +1618 to +1621
@overload
def __add__(
self: Series[Timestamp], other: _nonseries_timestamp | Series[Timestamp]
) -> Never: ...
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Disabling mypy from recognising Series[Any] + Series[Any] -> Series[Any] in test_sum_get_add and test_series_min_max_sub_axis

check(assert_type(sa, pd.Series), pd.Series)
check(assert_type(ss, pd.Series), pd.Series)
check(assert_type(sa, pd.Series), pd.Series) # type: ignore[assert-type]
check(assert_type(ss, pd.Series), pd.Series) # type: ignore[assert-type]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comment on lines +2819 to +2821
check(assert_type(s + summer, pd.Series), pd.Series) # type: ignore[assert-type]
check(assert_type(s + df["y"], pd.Series), pd.Series) # type: ignore[assert-type]
check(assert_type(summer + summer, pd.Series), pd.Series) # type: ignore[assert-type]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comment on lines +1271 to +1273
c_series_dt64: pd.Series[pd.Timestamp] = pd.Series(
[1, 2, 3], dtype="datetime64[ns]"
)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe

Suggested change
c_series_dt64: pd.Series[pd.Timestamp] = pd.Series(
[1, 2, 3], dtype="datetime64[ns]"
)
c_series_dt64 = pd.Series([1, 2, 3], dtype="datetime64[ns]")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant