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

Usage deprecated in pandas 0.23 #3018

Closed
pp-mo opened this issue May 16, 2018 · 6 comments
Closed

Usage deprecated in pandas 0.23 #3018

pp-mo opened this issue May 16, 2018 · 6 comments

Comments

@pp-mo
Copy link
Member

pp-mo commented May 16, 2018

There was initially a failure due to pandas 0.22 -> 0.23 in #3017,
fixed by a tiny tweak.

However there is an outstanding deprecation warning emerging from the tests ..

$ python lib/iris/tests/test_pandas.py -v TestAsSeries.test_copy_float_false
test_copy_float_false (__main__.TestAsSeries) ... /home/h05/itpp/git/iris/iris_main/lib/iris/pandas.py:133: FutureWarning: Series.base is deprecated and will be removed in a future version
  if hasattr(pandas_obj, 'base'):
/home/h05/itpp/git/iris/iris_main/lib/iris/pandas.py:134: FutureWarning: Series.base is deprecated and will be removed in a future version
  base = pandas_obj.base
ok

----------------------------------------------------------------------
Ran 1 test in 0.004s

OK

That arises from the code here

This is not so trivial a problem :
as existing code indicates, the usage of the 'base' property already changed.
If I understand right, potentially we can now just replace 'base' with 'values'.
- except that would no longer work with older versions of pandas.
However, right now, even testing for the presence of a '.base' attribute is triggering the deprecation warning.

@pp-mo pp-mo mentioned this issue May 16, 2018
@pelson
Copy link
Member

pelson commented May 16, 2018

We have talked very recently of deprecating this module. It won't solve our issue (as we still need to find a solution), but it may prevent this occurring in the future...

@hdyson
Copy link
Contributor

hdyson commented May 17, 2018

Apologies for butting in. Isn't the answer here to use (and check for) df.values.base instead of df.base, which would, I think, work with both older versions and 0.23?

As for deprecating this module, while I have used it for using iris with UGRID data, it's a bit of a niche usage so I'm not sure I could make a compelling case against deprecation.

@pelson
Copy link
Member

pelson commented Jun 11, 2018

@hdyson - I'm not close enough to the pandas API to answer definitively, but that suggestion sounds sensible. Would be happy to merge if you want to submit a PR?

@hdyson
Copy link
Contributor

hdyson commented Jun 11, 2018

@pelson A couple of quick questions here. Has there been a resolution to the conversation about deprecating the cube to/from dataframe/series functionality? And if it is to be deprecated, will this functionality leave iris before the switch over to a pandas version which will have an error rather than a deprecation warning?

For the fix itself, I'd be happy to provide it; I'm just trying to confirm we're not in "re-arranging deckchairs on the Titanic" territory.

@pelson
Copy link
Member

pelson commented Jun 11, 2018 via email

@rcomer
Copy link
Member

rcomer commented Sep 25, 2020

Looks like this was fixed by #3079.

@rcomer rcomer closed this as completed Sep 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants