Skip to content

Conversation

twoertwein
Copy link
Member

@twoertwein twoertwein commented Jun 9, 2022

generate_regular_range seems to be only called from un-annotated places: mypy doesn't know that start/end/periods can actually be None.

edit:
I'm not annotating the functions calling generate_regular_range in this PR as my aim with this PR is to simply make pandas/core/arrays/_ranges.py compatible with pyright.

@@ -11,13 +11,15 @@
[
# exclude tests
"pandas/tests",
# exclude vendored files
"pandas/io/clipboard",
"pandas/util/version",
Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Thanks!

periods: int,
start: Timestamp | Timedelta | None,
end: Timestamp | Timedelta | None,
periods: int | None,
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Mind updating the docstring below for this argument that periods can be None?

Copy link
Member Author

Choose a reason for hiding this comment

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

green and updated the doc-string

@mroeschke mroeschke added the Typing type annotations, mypy/pyright type checking label Jun 9, 2022
@mroeschke mroeschke added this to the 1.5 milestone Jun 9, 2022
@mroeschke mroeschke merged commit 264da3b into pandas-dev:main Jun 10, 2022
yehoshuadimarsky pushed a commit to yehoshuadimarsky/pandas that referenced this pull request Jul 13, 2022
* TYP: generate_regular_range

* update doc-string
@twoertwein twoertwein deleted the generate_regular_range branch September 21, 2022 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants