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

Pandas.Panel FutureWarning may become Error #824

Closed
StanczakDominik opened this issue Oct 20, 2019 · 20 comments · Fixed by #1127
Closed

Pandas.Panel FutureWarning may become Error #824

StanczakDominik opened this issue Oct 20, 2019 · 20 comments · Fixed by #1127
Assignees
Labels
eol ☠ Deprecations that are wont-fix candidates invalid ⛔ Not-an-issue or upstream (not-our-issue) p0-bug-critical ☢ Exception rasing p3-enhancement 🔥 Much new such feature submodule ⊂ Periphery/subclasses to-merge ↰ Imminent
Projects
Milestone

Comments

@StanczakDominik
Copy link

It looks like pandas.Panel is being deprecated:

In [1]: import pandas                                                                                                                                   

[ins] In [2]: pandas.__version__                                                                                                                              
Out[2]: '0.25.1'

[ins] In [3]: import tqdm                                                                                                                                     

[ins] In [4]: tqdm.__version__                                                                                                                                
Out[4]: '4.36.1'

[ins] In [5]: tqdm.tqdm.pandas()                                                                                                                              
/progs/miniconda3/lib/python3.7/site-packages/tqdm/std.py:648: FutureWarning: The Panel class is removed from pandas. Accessing it from the top-level namespace will also be removed in the next version
  from pandas import Panel

I haven't been able to find any other issues on this, so I figured I'd give you wonderful folks a heads up.

Is it going to be difficult to replace Panel?

@casperdcl
Copy link
Sponsor Member

duplicate of #780

really annoying since

  1. pandas major version is still 0 so they get to constantly break their API
  2. I don't use pandas but still feel forced to support it since I wrote this wrapper

@casperdcl casperdcl self-assigned this Oct 20, 2019
@casperdcl casperdcl added duplicate 🗐 Seen it before invalid ⛔ Not-an-issue or upstream (not-our-issue) question/docs ‽ Documentation clarification candidate submodule ⊂ Periphery/subclasses labels Oct 20, 2019
@casperdcl
Copy link
Sponsor Member

please reopen if (when) pandas breaks again

@StanczakDominik
Copy link
Author

Ah, apologies, I was looking for the FutureWarning in there. Of course, this is clearly the same issue - my bad.

@casperdcl
Copy link
Sponsor Member

yes but still going to need reopening at some point in the future. I'm not going to bother divining a decent future-proof wrapper for their messy API and incessant design shifts

@dgrahn
Copy link

dgrahn commented Oct 29, 2019

I hate to do this, but I think we need to reopen this issue. I'm seeing this behavior with pandas==0.25.2 and tqdm==4.36.1. So this is not covered by #780.

casperdcl added a commit that referenced this issue Oct 29, 2019
@casperdcl
Copy link
Sponsor Member

@dgrahn you should only be seeing a FutureWarning - which I'm going to just leave in there for now. I don't think I should be removing such a warning.

I'd prefer to only reopen this issue if (when) the Warning becomes an Error... Or perhaps prevent that from ever happening. hmmm. 59f457a

@casperdcl casperdcl added this to Next Release in Casper Oct 29, 2019
@casperdcl casperdcl added this to the v5.0.0 milestone Oct 29, 2019
@casperdcl casperdcl changed the title Pandas.Panel FutureWarning Pandas.Panel FutureWarning may become Error Oct 29, 2019
@casperdcl casperdcl removed the duplicate 🗐 Seen it before label Oct 29, 2019
@casperdcl casperdcl reopened this Oct 29, 2019
@casperdcl casperdcl added p0-bug-critical ☢ Exception rasing p3-enhancement 🔥 Much new such feature eol ☠ Deprecations that are wont-fix candidates to-merge ↰ Imminent and removed question/docs ‽ Documentation clarification candidate p5-wont-fix ☮ Sorry labels Oct 29, 2019
@dgrahn
Copy link

dgrahn commented Oct 29, 2019

@casperdcl My change removes the warning by removing the Panel functionality. This is inline with usage for pandas>=0.25.0. This would prevent the warning from ever becoming an error.

@casperdcl
Copy link
Sponsor Member

@dgrahn as pandas is a soft dependency (tqdm has no hard deps) this isn't feasible as we can't pin version numbers anywhere.

@dgrahn
Copy link

dgrahn commented Oct 29, 2019 via email

@casperdcl
Copy link
Sponsor Member

I don't use pandas at all, and strongly believe nobody else should, yet I wrote tqdm's wrapper for it in response to community demand. I feel said community of pandas aficionados expect default "it just works" as opposed to robust black&whitelisting.

@dgrahn
Copy link

dgrahn commented Oct 29, 2019 via email

@casperdcl
Copy link
Sponsor Member

After 59f457a it'll be default on (as it is now) but also silently not break when they remove the functionality.

I know atm tqdm.pandas users who don't use Panel still see this message but I see that as a good thing highlighting a changing API.

@casperdcl
Copy link
Sponsor Member

If there's any pandas core dev who disagrees then I'd be happy to suppress the warning

@dgrahn
Copy link

dgrahn commented Oct 30, 2019

So... "I don't like Pandas because they change their API. I want people to see a warning because I don't like Pandas. And I won't include an option to suppress that warning."?

I'm also failing to see an issue with dropping support for a deprecated piece of functionality. Release notes could specify to use the functionality, go to an older verison.

@casperdcl
Copy link
Sponsor Member

casperdcl commented Oct 30, 2019

xD definitely not.

I don't like Pandas because they change their API

I don't like pandas for many reasons, none of which I am under any obligation to explain owing to the thankless unfunded open source nature of my voluntary contributions. My expression of dislike is intended to spur pandas experts to fight back (ideally using code rather than words).

I want people to see a warning because I don't like Pandas

I think pandas devs would want people to see a warning since tqdm.pandas is really beta anyway. Nobody's actually checked the code.

And I won't include an option to suppress that warning

True, unless convinced otherwise. I believe 1) this will disappear when the functionality is removed (warning will turn into an Import Error which is caught by 59f457a) and 2) I think it's fine to warn about default-on leaving users/devs to wrap code with a simple warnings.filterwarnings if they are happy to suppress it. Worst case scenario is lots of people wind up reading this issue and get vaguely perplexed. Better case is they get amused. Best is they contribute!

I'm also failing to see an issue with dropping support for a deprecated piece of functionality

This is perhaps true for most software. However, unfortunately, with massively used things (like tqdm or even python2 itself) - in the words of Joshua Bloch - APIs are forever.

@dgrahn
Copy link

dgrahn commented Oct 30, 2019 via email

@casperdcl casperdcl mentioned this issue Oct 31, 2019
@casperdcl
Copy link
Sponsor Member

Yes, perhaps. The thing is pandas is used widely enough and people in general prefer ease of use and installation (https://www.dreamsongs.com/RiseOfWorseIsBetter.html etc...). In general though I hope with #815 many different "here be dragons" contributions can be merged in without me feeling responsible or guilty :)

@casperdcl
Copy link
Sponsor Member

closed by #834

Casper automation moved this from Next Release to Done Nov 21, 2019
@th0ger
Copy link

th0ger commented Mar 27, 2020

I ended up reading this issue and got vaguely perplexed. Also got slightly amused. Unfortunately not contributing.

@casperdcl
Copy link
Sponsor Member

casperdcl commented Feb 18, 2021

FYI #1094 (comment):

In any case pandas>=1.2.0 doesn't cause this error anyway (pandas-dev/pandas#37983). Now that it's fixed, I'm ok with adding an extra suppression just for those still using older versions.

Warning will disappear using either tqdm>=4.57.0 (#1127) or pandas>=1.2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
eol ☠ Deprecations that are wont-fix candidates invalid ⛔ Not-an-issue or upstream (not-our-issue) p0-bug-critical ☢ Exception rasing p3-enhancement 🔥 Much new such feature submodule ⊂ Periphery/subclasses to-merge ↰ Imminent
Projects
Casper
  
Done
Development

Successfully merging a pull request may close this issue.

4 participants