Skip to content

on master, pd.show_versions() emits a FutureWarning #30872

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
Dr-Irv opened this issue Jan 9, 2020 · 12 comments
Closed

on master, pd.show_versions() emits a FutureWarning #30872

Dr-Irv opened this issue Jan 9, 2020 · 12 comments
Labels
Warnings Warnings that appear or should be added to pandas

Comments

@Dr-Irv
Copy link
Contributor

Dr-Irv commented Jan 9, 2020

Code Sample, a copy-pastable example if possible

import pandas as  pd
pd.show_versions()

Problem description

Gets this output:

C:\Code\pandas_dev\pandas36\pandas\core\index.py:29: FutureWarning: pandas.core.index is deprecated and will be removed in a future version.  The public classes are available in the top-level namespace.
  FutureWarning,

INSTALLED VERSIONS
------------------

followed by all the version stuff

Expected Output

No FutureWarning

Output of pd.show_versions()

C:\Code\pandas_dev\pandas36\pandas\core\index.py:29: FutureWarning: pandas.core.index is deprecated and will be removed in a future version. The public classes are available in the top-level namespace.
FutureWarning,

INSTALLED VERSIONS

commit : 7cce2c7
python : 3.6.7.final.0
python-bits : 64
OS : Windows
OS-release : 10
machine : AMD64
processor : Intel64 Family 6 Model 158 Stepping 13, GenuineIntel
byteorder : little
LC_ALL : None
LANG : None
LOCALE : None.None

pandas : 0.26.0.dev0+1739.g7cce2c7f4
numpy : 1.15.4
pytz : 2019.3
dateutil : 2.8.1
pip : 19.3.1
setuptools : 44.0.0.post20200102
Cython : 0.29.14
pytest : 5.3.2
hypothesis : 5.1.1
sphinx : None
blosc : None
feather : None
xlsxwriter : 1.2.7
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.10.3
IPython : 7.11.1
pandas_datareader: None
bs4 : None
bottleneck : 1.3.1
fastparquet : 0.3.2
gcsfs : None
lxml.etree : None
matplotlib : 3.0.2
numexpr : 2.7.1
odfpy : None
openpyxl : 3.0.1
pandas_gbq : None
pyarrow : 0.14.1
pytables : None
pytest : 5.3.2
s3fs : None
scipy : 1.3.1
sqlalchemy : None
tables : 3.6.1
tabulate : None
xarray : None
xlrd : 1.2.0
xlwt : 1.3.0
xlsxwriter : 1.2.7
numba : 0.46.0

@Dr-Irv
Copy link
Contributor Author

Dr-Irv commented Jan 9, 2020

This seems to be due to a dependency on fastparquet

Python 3.7.6 | packaged by conda-forge | (default, Dec 26 2019, 23:30:11) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import fastparquet
c:\Code\pandas_dev\pandas\pandas\core\index.py:29: FutureWarning: pandas.core.index is deprecated and will be removed in a future version.  The public classes are available in the top-level namespace.
  FutureWarning,

@jorisvandenbossche I think you mentioned you were working on some parquet stuff, so maybe you are aware of this

@simonjayhawkins simonjayhawkins added this to the 1.0.0 milestone Jan 9, 2020
@simonjayhawkins simonjayhawkins added the Warnings Warnings that appear or should be added to pandas label Jan 9, 2020
@simonjayhawkins
Copy link
Member

I've added the milestone, since I think this has only just appeared. (Can't be sure without checking)

@jorisvandenbossche
Copy link
Member

That's up to fastparquet to fix, not pandas (we are missing a stacklevel to make it clearer where it is coming from, though).

Anybody wants to open an issue on the fastparquet tracker?

@jorisvandenbossche jorisvandenbossche removed the Warnings Warnings that appear or should be added to pandas label Jan 10, 2020
@jorisvandenbossche jorisvandenbossche removed this from the 1.0.0 milestone Jan 10, 2020
@Dr-Irv
Copy link
Contributor Author

Dr-Irv commented Jan 10, 2020

@jorisvandenbossche you opened the issue about a month ago: dask/fastparquet#470

Having said that, since we ask people to use pd.show_versions() when reporting issues, do we want to suppress any such warnings in that function to avoid people getting confused by the message?

@jorisvandenbossche
Copy link
Member

@jorisvandenbossche you opened the issue about a month ago

Ah, yes ;-)

I don't have a strong opinion on filtering it in show_versions. On the one hand, it also signals problems (as you noticed now), on the other hand it gives warnings users can't do nothing about.

@Dr-Irv
Copy link
Contributor Author

Dr-Irv commented Jan 13, 2020

@jorisvandenbossche I would suggest the following:

  • With pd.show_versions(), we don't emit warnings
  • With pd.show_versions(show_warnings=True), we then emit the warnings

My sense is that the default should not emit the warnings so we don't get people wondering what is going on when they report issues.

Separately, I'm guessing we could do some kind of regular thing in CI to do pd.show_versions(show_warnings=True) and catch the warnings, and then we know which projects to raise issues in so they update their usage of pandas.

Also, given our discussion here, I've reopened this issue (you had closed it) so we can settle this point.

@Dr-Irv Dr-Irv reopened this Jan 13, 2020
@TomAugspurger
Copy link
Contributor

I think we should just handle this in fastparquet. I'll make a PR.

@Dr-Irv
Copy link
Contributor Author

Dr-Irv commented Jan 13, 2020

@TomAugspurger What if we start getting warnings from other libraries in the future as we deprecate more things in pandas? Shouldn't we do something in pd.show_versions()?

@TomAugspurger
Copy link
Contributor

TomAugspurger commented Jan 13, 2020 via email

@Dr-Irv
Copy link
Contributor Author

Dr-Irv commented Jan 13, 2020

@TomAugspurger So now that you have patched fastparquet, they would need a new release, and do we need to update the version requirement in pandas/compat/_optional.py at some point?

@TomAugspurger
Copy link
Contributor

TomAugspurger commented Jan 13, 2020 via email

@jbrockmendel jbrockmendel added the Warnings Warnings that appear or should be added to pandas label Feb 25, 2020
@mroeschke
Copy link
Member

Since this has been long since fixed, probably okay to close now

In [18]: pd.show_versions()

INSTALLED VERSIONS
------------------
commit           : c1aea793e03f11b587fbda833b2f5ad06c4bbced
python           : 3.8.6.final.0
python-bits      : 64
OS               : Darwin
OS-release       : 19.6.0
Version          : Darwin Kernel Version 19.6.0: Thu May  6 00:48:39 PDT 2021; root:xnu-6153.141.33~1/RELEASE_X86_64
machine          : x86_64
processor        : i386
byteorder        : little
LC_ALL           : None
LANG             : en_US.UTF-8
LOCALE           : en_US.UTF-8

pandas           : 1.4.0.dev0+285.gc1aea793e0
numpy            : 1.21.0
pytz             : 2021.1
dateutil         : 2.8.1
pip              : 21.1.3
setuptools       : 52.0.0.post20210125
Cython           : 0.29.21
pytest           : 6.2.4
hypothesis       : 6.14.0
sphinx           : 3.5.4
blosc            : None
feather          : None
xlsxwriter       : 1.4.3
lxml.etree       : 4.6.3
html5lib         : 1.1
pymysql          : None
psycopg2         : None
jinja2           : 2.11.3
IPython          : 7.25.0
pandas_datareader: None
bs4              : 4.9.3
bottleneck       : 1.3.2
fsspec           : 2021.05.0
fastparquet      : 0.6.3
gcsfs            : 2021.05.0
matplotlib       : 3.3.3
numexpr          : 2.7.2
odfpy            : None
openpyxl         : 3.0.7
pandas_gbq       : None
pyarrow          : 2.0.0
pyxlsb           : None
s3fs             : 2021.05.0
scipy            : 1.6.0
sqlalchemy       : 1.4.20
tables           : 3.6.1
tabulate         : 0.8.9
xarray           : 0.18.2
xlrd             : 2.0.1
xlwt             : 1.3.0
numba            : 0.52.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Warnings Warnings that appear or should be added to pandas
Projects
None yet
Development

No branches or pull requests

6 participants