Skip to content

Commit 7acc233

Browse files
author
dhirschf
committed
Add shim modules with deprecation warnings to ensure backward compatibility
The following shim modules are included: - `pandas.computation` - `pandas.tools.hashing` - `pandas.types` Fixes pandas-dev#16138
1 parent d50b162 commit 7acc233

22 files changed

+51
-0
lines changed

pandas/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
from pandas.io.api import *
5959
from pandas.util._tester import test
6060
import pandas.testing
61+
from . import computation # TODO: Remove when deprecated shim module is removed
6162

6263
# extension module deprecations
6364
from pandas.util.depr_module import _DeprecatedModule

pandas/computation/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import warnings
2+
3+
4+
warnings.warn(
5+
"The pandas.computation module is deprecated and will be removed in a future "
6+
"version. Please import from the pandas.core.computation module instead.",
7+
FutureWarning, stacklevel=2
8+
)
9+
10+
11+
from . import (
12+
align, api, common, engines, eval,
13+
expr, expressions, ops, pytables, scope
14+
)

pandas/computation/align.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from pandas.core.computation.align import *

pandas/computation/api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from pandas.core.computation.api import *

pandas/computation/common.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from pandas.core.computation.common import *

pandas/computation/engines.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from pandas.core.computation.engines import *

pandas/computation/eval.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from pandas.core.computation.eval import *

pandas/computation/expr.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from pandas.core.computation.expr import *

pandas/computation/expressions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from pandas.core.computation.expressions import *

pandas/computation/ops.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from pandas.core.computation.ops import *

pandas/computation/pytables.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from pandas.core.computation.pytables import *

pandas/computation/scope.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from pandas.core.computation.scope import *

pandas/tools/hashing/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import warnings
2+
3+
4+
warnings.warn(
5+
"The pandas.tools.hashimg module is deprecated and will be removed in a "
6+
"future version. Please import from the pandas.util.hashing module instead.",
7+
FutureWarning, stacklevel=2
8+
)
9+
10+
from pandas.util.hashing import *

pandas/types/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import warnings
2+
3+
4+
warnings.warn(
5+
"The pandas.types module is deprecated and will be removed in a future "
6+
"version. Please import from the pandas.core.dtypes module instead.",
7+
FutureWarning, stacklevel=2
8+
)

pandas/types/api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from pandas.core.dtypes.api import *

pandas/types/cast.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from pandas.core.dtypes.cast import *

pandas/types/common.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from pandas.core.dtypes.common import *

pandas/types/concat.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from pandas.core.dtypes.concat import *

pandas/types/dtypes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from pandas.core.dtypes.dtypes import *

pandas/types/generic.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from pandas.core.dtypes.generic import *

pandas/types/inference.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from pandas.core.dtypes.inference import *

pandas/types/missing.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from pandas.core.dtypes.missing import *

0 commit comments

Comments
 (0)