-
-
Notifications
You must be signed in to change notification settings - Fork 146
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
base: main
Are you sure you want to change the base?
Conversation
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, | ||
) |
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.
These type: ignore
s will be removed in #1273
@overload | ||
def __sub__( | ||
self, other: Timestamp | datetime | TimestampSeries | ||
self, other: Timestamp | datetime | Series[Timestamp] | ||
) -> TimedeltaSeries: ... |
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.
Disabling mypy
from recognising ss = s1 - s2
in test_series_min_max_sub_axis
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.
@overload | ||
def __add__( | ||
self: Series[Timestamp], other: _nonseries_timestamp | Series[Timestamp] | ||
) -> Never: ... |
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.
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] |
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.
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] |
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.
c_series_dt64: pd.Series[pd.Timestamp] = pd.Series( | ||
[1, 2, 3], dtype="datetime64[ns]" | ||
) |
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.
Maybe
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]") |
assert_type()
to assert the type of any return value