Skip to content

CustomBusinessDay annotation is not complete #222

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

Closed
gandhis1 opened this issue Aug 24, 2022 · 3 comments
Closed

CustomBusinessDay annotation is not complete #222

gandhis1 opened this issue Aug 24, 2022 · 3 comments

Comments

@gandhis1
Copy link
Contributor

gandhis1 commented Aug 24, 2022

The initializer does not appear to match as it is missing holidays and calendar https://pandas.pydata.org/docs/reference/api/pandas.tseries.offsets.CustomBusinessDay.html

@gandhis1 gandhis1 changed the title CustomBusinessDay annotation is missing holidays and calendar CustomBusinessDay annotation is not complete Aug 24, 2022
@Dr-Irv
Copy link
Collaborator

Dr-Irv commented Aug 24, 2022

Please provide an example that illustrates a type checker showing an error.

@gandhis1
Copy link
Contributor Author

import pandas as pd
from pandas.tseries.offsets import CustomBusinessDay
from pandas.tseries.holiday import USFederalHolidayCalendar

x = CustomBusinessDay(holidays=USFederalHolidayCalendar())

test_case.py:3: error: Skipping analyzing "pandas.tseries.holiday": found module but no type hints or library stubs
test_case.py:3: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
test_case.py:5: error: Unexpected keyword argument "holidays" for "CustomBusinessDay"
.../lib/python3.8/site-packages/pandas-stubs/_libs/tslibs/offsets.pyi:203: note: "CustomBusinessDay" defined here

@Dr-Irv
Copy link
Collaborator

Dr-Irv commented Aug 28, 2022

That's not valid code, but this is and will be fixed in a PR:

from pandas.tseries.offsets import CustomBusinessDay
from pandas.tseries.holiday import USFederalHolidayCalendar

x = CustomBusinessDay(calendar=USFederalHolidayCalendar())

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

No branches or pull requests

3 participants