-
-
Notifications
You must be signed in to change notification settings - Fork 137
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
type freq in shift #1108
base: main
Are you sure you want to change the base?
type freq in shift #1108
Conversation
@@ -416,10 +416,11 @@ def test_types_sort_values_with_key() -> None: | |||
|
|||
|
|||
def test_types_shift() -> None: | |||
s = pd.Series([1, 2, 3]) | |||
s = pd.Series([1, 2, 3], index=pd.date_range("2020", periods=3)) |
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.
🤔 trying to add a test for this, the type actually changes from Series['int'] to Series['float'], taking a look
# Return type "Series[int]"" not quite correct | ||
# - https://github.com/pandas-dev/pandas-stubs/issues/1111 | ||
# - https://github.com/pandas-dev/pandas-stubs/issues/1110 |
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've kept the return type of shift
as-is, in order to focus on typing freq
Happy to update the return type too based on discussion in the issues
assert_type()
to assert the type of any return value