Skip to content

Commit d5dfe74

Browse files
gfyoungjreback
authored andcommitted
COMPAT: Make is_number import backwards-compat (#309)
1 parent 91d5541 commit d5dfe74

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,3 @@ script:
4848

4949
after_success:
5050
- coveralls
51-

pandas_datareader/compat/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
11
# flake8: noqa
2+
import pandas as pd
3+
24
from io import BytesIO
5+
from distutils.version import LooseVersion
6+
7+
pandas_version = LooseVersion(pd.__version__)
8+
if pandas_version <= '0.19.2':
9+
from pandas.core.common import is_number
10+
else:
11+
from pandas.api.types import is_number

pandas_datareader/edgar.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,13 @@
33
from ftplib import FTP
44
import gzip
55

6-
from pandas import read_csv
7-
from pandas import DataFrame
8-
from pandas import to_datetime
96
from zipfile import ZipFile
107
from pandas.compat import StringIO
11-
from pandas.api.types import is_number
8+
from pandas import read_csv, DataFrame, to_datetime
129

1310
from pandas_datareader.base import _BaseReader
14-
from pandas_datareader.compat import BytesIO
1511
from pandas_datareader._utils import RemoteDataError
12+
from pandas_datareader.compat import BytesIO, is_number
1613

1714

1815
_URL_FULL = 'edgar/full-index/master.zip'

0 commit comments

Comments
 (0)