From 049d2291c472dbe830032ad8faec447e0aac83e8 Mon Sep 17 00:00:00 2001 From: DHuan Date: Tue, 23 Jul 2019 12:46:44 +0800 Subject: [PATCH] Fix PandasOptionError import. --- odps/config.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/odps/config.py b/odps/config.py index 610c369d..361f5a5c 100644 --- a/odps/config.py +++ b/odps/config.py @@ -83,7 +83,12 @@ def __init__(self, *args, **kw): def getvalue(self, silent=False): if self._use_pd: import pandas as pd - from pandas.core.config import OptionError as PandasOptionError + if pd.__version__ < '0.25.0': + from pandas.core.config import OptionError as PandasOptionError + else: + # `pandas.core` was moved to `pandas._config` + # and made private after `v0.25.0` + from pandas._config.config import OptionError as PandasOptionError try: return pd.get_option('.'.join(self._items)) except PandasOptionError: