Skip to content

TYP: fix a few annotations in offsets.pyi #46920

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 3 commits into from
May 3, 2022
Merged

TYP: fix a few annotations in offsets.pyi #46920

merged 3 commits into from
May 3, 2022

Conversation

twoertwein
Copy link
Member

Some doc-strings refer to pd.HolidayCalendar but that doesn't seem to exist?!

There are a few more un-annotated variables and a few containers (list and dict) without types but I'm not familair enough with them to annotate them.

@twoertwein twoertwein requested a review from Dr-Irv May 1, 2022 18:19
Copy link
Contributor

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

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

I checked your changes against current API. Did not check if there are others that need fixing - assume you did that. Small changes to make

Copy link
Contributor

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

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

This is a minor thing, but you have this:

        holidays: None | list = ...,
        calendar: np.busdaycalendar | None = ...,

Have we standardized on whether we put None last or first? If not, we should be consistent within this file.

@twoertwein
Copy link
Member Author

Have we standardized on whether we put None last or first?

Not that I'm aware of. The only example I found is here: https://pandas.pydata.org/docs/development/contributing_codebase.html#style-guidelines (None at the end).

@Dr-Irv
Copy link
Contributor

Dr-Irv commented May 1, 2022

Have we standardized on whether we put None last or first?

Not that I'm aware of. The only example I found is here: https://pandas.pydata.org/docs/development/contributing_codebase.html#style-guidelines (None at the end).

I think we use the style of str | None more than None | str, so can you use the former throughout in this file for this PR?

@Dr-Irv Dr-Irv merged commit 8bc0832 into pandas-dev:main May 3, 2022
@Dr-Irv
Copy link
Contributor

Dr-Irv commented May 3, 2022

Thanks @twoertwein

@twoertwein twoertwein deleted the offsets branch May 26, 2022 01:59
yehoshuadimarsky pushed a commit to yehoshuadimarsky/pandas that referenced this pull request Jul 13, 2022
* TYP: fix a few annotations in offsets.pyi

* variation + calendar

* None at the end
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.

TYP: offsets.WeekOfMonth needs better typing
2 participants