1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
Description: Be compatible with pandas 0.25
Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Bug-Debian: https://bugs.debian.org/943925
Forwarded: not-needed (upstream have switched to pyarrow)
--- python-feather-format-0.3.1+dfsg1.orig/feather/api.py
+++ python-feather-format-0.3.1+dfsg1/feather/api.py
@@ -15,6 +15,7 @@
import six
from distutils.version import LooseVersion
import pandas as pd
+import pandas.api.types
from feather.compat import pdapi
import feather.ext as ext
@@ -40,7 +41,7 @@ def write_dataframe(df, path):
col = df.iloc[:, i]
if pdapi.is_object_dtype(col):
- inferred_type = pd.lib.infer_dtype(col)
+ inferred_type = pandas.api.types.infer_dtype(col)
msg = ("cannot serialize column {n} "
"named {name} with dtype {dtype}".format(
n=i, name=name, dtype=inferred_type))
@@ -48,7 +49,7 @@ def write_dataframe(df, path):
if inferred_type in ['mixed']:
# allow columns with nulls + an inferable type
- inferred_type = pd.lib.infer_dtype(col[col.notnull()])
+ inferred_type = pandas.api.types.infer_dtype(col[col.notnull()])
if inferred_type in ['mixed']:
raise ValueError(msg)
--- python-feather-format-0.3.1+dfsg1.orig/feather/tests/test_reader.py
+++ python-feather-format-0.3.1+dfsg1/feather/tests/test_reader.py
@@ -361,8 +361,8 @@ class TestFeatherReader(unittest.TestCas
# period
df = pd.DataFrame({'a': pd.period_range('2013', freq='M', periods=3)})
- self._assert_error_on_write(df, ValueError)
+ self._assert_error_on_write(df, (feather.FeatherError,ValueError))
# non-strings
df = pd.DataFrame({'a': ['a', 1, 2.0]})
- self._assert_error_on_write(df, ValueError)
+ self._assert_error_on_write(df, (feather.FeatherError,ValueError))
|