Skip to content
This repository was archived by the owner on Jul 12, 2022. It is now read-only.

Commit 3c7ab11

Browse files
committed
fix(pandas): pandas-0.20.1 dropped PandasError class.
+ See pydata/pandas-datareader#305
1 parent e72fa3c commit 3c7ab11

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

wltp/model.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
from jsonschema import (RefResolver, ValidationError)
3131
import jsonschema
3232
from numpy import ndarray
33-
from pandas.core.common import PandasError
3433
from pandas.core.generic import NDFrame
3534
from six import string_types
3635
from wltp.cycles import (class1, class2, class3)
@@ -41,6 +40,13 @@
4140
import operator as ops
4241
import pandas as pd
4342

43+
try:
44+
from pandas.core.common import PandasError
45+
except ImportError:
46+
## Pandas-0.20.1 dropped this classs.
47+
# See https://github.com/pydata/pandas-datareader/issues/305
48+
PandasError = ValueError
49+
4450

4551
log = logging.getLogger(__name__)
4652

wltp/test/experiment_ForcedCycle.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,19 @@
1313
from wltp.experiment import Experiment
1414
from wltp.test.goodvehicle import goodVehicle
1515

16-
from pandas.core.common import PandasError
17-
1816
import numpy as np
1917
import numpy.testing as npt
2018
import pandas as pd
2119

2220
from ..utils import assertRaisesRegex
2321

22+
try:
23+
from pandas.core.common import PandasError
24+
except ImportError:
25+
## Pandas-0.20.1 dropped this classs.
26+
# See https://github.com/pydata/pandas-datareader/issues/305
27+
PandasError = ValueError
28+
2429

2530
class TestForcedCycle(unittest.TestCase):
2631
def setUp(self):

0 commit comments

Comments
 (0)