Skip to content
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

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

Conversation

MarcoGorelli
Copy link
Member

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

@MarcoGorelli MarcoGorelli marked this pull request as ready for review February 7, 2025 18:27
@@ -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))
Copy link
Member Author

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

@MarcoGorelli MarcoGorelli marked this pull request as ready for review February 8, 2025 12:18
Comment on lines +420 to +422
# 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
Copy link
Member Author

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

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