Skip to content

TYP: freq and na_value #47729

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

Merged
merged 4 commits into from
Jul 18, 2022
Merged

TYP: freq and na_value #47729

merged 4 commits into from
Jul 18, 2022

Conversation

twoertwein
Copy link
Member

Type annotations are only related by having lib.no_default as a default value (pyright then assumes that their type is lib.NoDefault).

cls, values: np.ndarray, freq: BaseOffset | None = None, dtype=DT64NS_DTYPE
cls,
values: np.ndarray,
freq: str | BaseOffset | lib.NoDefault | None = None,
Copy link
Member

Choose a reason for hiding this comment

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

@jbrockmendel should the caller ensure the freq is not a string when calling _simple_new?

Copy link
Member

Choose a reason for hiding this comment

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

this should be BaseOffset | 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.

Thank you, I changed it!

@twoertwein twoertwein added the Typing type annotations, mypy/pyright type checking label Jul 17, 2022
@mroeschke mroeschke added this to the 1.5 milestone Jul 18, 2022
@mroeschke mroeschke merged commit efd15b7 into pandas-dev:main Jul 18, 2022
@mroeschke
Copy link
Member

Thanks @twoertwein

@twoertwein twoertwein deleted the freq_na branch September 10, 2022 01:39
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.

3 participants