Skip to content

COMPAT: Make is_number import backwards-compat #309

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

Merged
merged 1 commit into from
May 8, 2017
Merged

COMPAT: Make is_number import backwards-compat #309

merged 1 commit into from
May 8, 2017

Conversation

gfyoung
Copy link
Contributor

@gfyoung gfyoung commented May 7, 2017

Title is self-explanatory.

xref #304.


from pandas_datareader.base import _BaseReader
from pandas_datareader.compat import BytesIO
from pandas_datareader._utils import RemoteDataError

if LooseVersion(pd.__version__) <= '0.19.2':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would put this in pandas_datareader/compat/__init__.py

if LooseVersion(.....):
       from pandas.core import common as pdapi
else:
      from pandas.api import types as pdapi

then you can

from pandas_datareader.compat import pdapi

Copy link
Contributor Author

@gfyoung gfyoung May 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That works too (actually didn't see that).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if directly import is_number in compat is ok too. this then isolates all version specific things there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That works too.

@jreback jreback merged commit d5dfe74 into pydata:master May 8, 2017
@jreback
Copy link
Contributor

jreback commented May 8, 2017

thanks!

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.

2 participants