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

BUG: pd.PeriodDtype(freq=CustomBusinessDay()) raises on main but isn't deprecated #52790

Closed
3 tasks done
twoertwein opened this issue Apr 19, 2023 · 4 comments
Closed
3 tasks done
Labels
Bug Period Period data type

Comments

@twoertwein
Copy link
Member

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

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

pd.PeriodDtype(freq=CustomBusinessDay()) # raises TypeError: CustomBusinessDay cannot be used with Period or PeriodDtype

Issue Description

The above works on 2.0 without any FutureWarning but raises on main.

xref pandas-dev/pandas-stubs#640

Expected Behavior

Add a deprecation warning

Installed Versions

INSTALLED VERSIONS ------------------ commit : 478d340 python : 3.11.2.final.0 python-bits : 64 OS : Linux OS-release : 6.2.9-200.fc37.x86_64 Version : #1 SMP PREEMPT_DYNAMIC Thu Mar 30 22:31:57 UTC 2023 machine : x86_64 processor : byteorder : little LC_ALL : None LANG : C.UTF-8 LOCALE : en_US.UTF-8 pandas : 2.0.0 numpy : 1.24.2 pytz : 2023.3 dateutil : 2.8.2 setuptools : 67.6.1 pip : 22.3.1 Cython : 0.29.34 pytest : 7.3.1 hypothesis : None sphinx : None blosc : None feather : None xlsxwriter : 3.0.7 lxml.etree : 4.9.2 html5lib : 1.1 pymysql : None psycopg2 : None jinja2 : 3.1.2 IPython : 8.8.0 pandas_datareader: None bs4 : None bottleneck : None brotli : None fastparquet : None fsspec : 2023.4.0 gcsfs : None matplotlib : None numba : None numexpr : 2.8.4 odfpy : None openpyxl : None pandas_gbq : None pyarrow : 11.0.0 pyreadstat : None pyxlsb : None s3fs : None scipy : 1.10.1 snappy : None sqlalchemy : None tables : 3.8.0 tabulate : None xarray : None xlrd : 2.0.1 zstandard : None tzdata : 2023.3 qtpy : None pyqt5 : None
@twoertwein twoertwein added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Apr 19, 2023
@mroeschke
Copy link
Member

mroeschke commented Apr 19, 2023

I think this was deemed a "bug" cc @jbrockmendel

#52534

@jbrockmendel
Copy link
Member

correct, xref #52534

@twoertwein
Copy link
Member Author

Okay! Happy to close this issue then - unless you want to add a warning for a 2.0.1 release.

@DeaMariaLeon DeaMariaLeon removed the Needs Triage Issue that has not been reviewed by a pandas team member label Apr 20, 2023
@rhshadrach rhshadrach added the Period Period data type label Apr 21, 2023
@phofl
Copy link
Member

phofl commented Apr 22, 2023

Closing, we don't add deprecations in a bug fix release

@phofl phofl closed this as completed Apr 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Period Period data type
Projects
None yet
Development

No branches or pull requests

6 participants