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

change to imports for pandas Timestamp module #643

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

panzerstadt
Copy link

pandas 0.23.0
ggplot 0.11.5

changed from pandas.lib import Timestamp to from pandas import Timestamp, might break compability with old pandas.

an alternative may be to do a try except....? which might look pretty bad, but I haven't really researched into how to support multiple pandas versions with different import endpoints.

reference: https://stackoverflow.com/questions/50591982/importerror-cannot-import-name-timestamp

pandas 0.23.0
ggplot 0.11.5

changed `from pandas.lib import Timestamp` to `from pandas import Timestamp`, might break compability with old pandas.

an alternative may be to do a try except....? which might look pretty bad, but I haven't really researched into how to support multiple pandas versions with different import endpoints.

reference: https://stackoverflow.com/questions/50591982/importerror-cannot-import-name-timestamp
@lukesmurray
Copy link

Anyway this could be merged @glamp?

@ghost
Copy link

ghost commented Jun 15, 2018

smoothers.py:4: FutureWarning: The pandas.lib module is deprecated and will be removed in a future version. These are private functions and can be accessed from pandas._libs.lib instead

The deprecation message is not great advice, the public interface is pandas.Timstamp so this PR is doing the right thing.
I don't think there's anything wrong with doing a try / catch for library imports but in this case I don't see it breaking backwards compatibility. I can see pandas.Timestamp mentioned back in v0.13 which is very old indeed http://pandas.pydata.org/pandas-docs/version/0.13/10min.html?highlight=timestamp

I've tested it against 0.19.0 as well and the import works fine as per this patch

>>> import pandas as pd
>>> pd.__version__
u'0.19.0'
>>> from pandas import Timestamp
>>>

Note, there's a second deprecation message that comes from running gglplot's smoothers.py:

FutureWarning: pandas.tslib is deprecated and will be removed in a future version.

This is from line 14. It hasn't been removed from Pandas yet but will cause a similar issue that this PR addresses.

@Ozeidi
Copy link

Ozeidi commented Jul 19, 2018

Please merge this to align with recent panda changes.

@whyboris
Copy link

Please merge this -- I am unable to use ggplot without manually having to edit the installed module 😢

@sushinoya
Copy link

Can we please merge this?

@sushinoya sushinoya mentioned this pull request Oct 5, 2018
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

Successfully merging this pull request may close these issues.

5 participants