From 7acc23359f15c130ee325d823c7c2ccb86123544 Mon Sep 17 00:00:00 2001 From: dhirschf Date: Wed, 26 Apr 2017 12:27:25 +1000 Subject: [PATCH] Add shim modules with deprecation warnings to ensure backward compatibility The following shim modules are included: - `pandas.computation` - `pandas.tools.hashing` - `pandas.types` Fixes #16138 --- pandas/__init__.py | 1 + pandas/computation/__init__.py | 14 ++++++++++++++ pandas/computation/align.py | 1 + pandas/computation/api.py | 1 + pandas/computation/common.py | 1 + pandas/computation/engines.py | 1 + pandas/computation/eval.py | 1 + pandas/computation/expr.py | 1 + pandas/computation/expressions.py | 1 + pandas/computation/ops.py | 1 + pandas/computation/pytables.py | 1 + pandas/computation/scope.py | 1 + pandas/tools/hashing/__init__.py | 10 ++++++++++ pandas/types/__init__.py | 8 ++++++++ pandas/types/api.py | 1 + pandas/types/cast.py | 1 + pandas/types/common.py | 1 + pandas/types/concat.py | 1 + pandas/types/dtypes.py | 1 + pandas/types/generic.py | 1 + pandas/types/inference.py | 1 + pandas/types/missing.py | 1 + 22 files changed, 51 insertions(+) create mode 100644 pandas/computation/__init__.py create mode 100644 pandas/computation/align.py create mode 100644 pandas/computation/api.py create mode 100644 pandas/computation/common.py create mode 100644 pandas/computation/engines.py create mode 100644 pandas/computation/eval.py create mode 100644 pandas/computation/expr.py create mode 100644 pandas/computation/expressions.py create mode 100644 pandas/computation/ops.py create mode 100644 pandas/computation/pytables.py create mode 100644 pandas/computation/scope.py create mode 100644 pandas/tools/hashing/__init__.py create mode 100644 pandas/types/__init__.py create mode 100644 pandas/types/api.py create mode 100644 pandas/types/cast.py create mode 100644 pandas/types/common.py create mode 100644 pandas/types/concat.py create mode 100644 pandas/types/dtypes.py create mode 100644 pandas/types/generic.py create mode 100644 pandas/types/inference.py create mode 100644 pandas/types/missing.py diff --git a/pandas/__init__.py b/pandas/__init__.py index 43fa362b66ed5..f83a4ba14d852 100644 --- a/pandas/__init__.py +++ b/pandas/__init__.py @@ -58,6 +58,7 @@ from pandas.io.api import * from pandas.util._tester import test import pandas.testing +from . import computation # TODO: Remove when deprecated shim module is removed # extension module deprecations from pandas.util.depr_module import _DeprecatedModule diff --git a/pandas/computation/__init__.py b/pandas/computation/__init__.py new file mode 100644 index 0000000000000..16942b25b45a1 --- /dev/null +++ b/pandas/computation/__init__.py @@ -0,0 +1,14 @@ +import warnings + + +warnings.warn( + "The pandas.computation module is deprecated and will be removed in a future " + "version. Please import from the pandas.core.computation module instead.", + FutureWarning, stacklevel=2 +) + + +from . import ( + align, api, common, engines, eval, + expr, expressions, ops, pytables, scope +) diff --git a/pandas/computation/align.py b/pandas/computation/align.py new file mode 100644 index 0000000000000..3aa4ad3b9254c --- /dev/null +++ b/pandas/computation/align.py @@ -0,0 +1 @@ +from pandas.core.computation.align import * diff --git a/pandas/computation/api.py b/pandas/computation/api.py new file mode 100644 index 0000000000000..278e9fa56d3cb --- /dev/null +++ b/pandas/computation/api.py @@ -0,0 +1 @@ +from pandas.core.computation.api import * diff --git a/pandas/computation/common.py b/pandas/computation/common.py new file mode 100644 index 0000000000000..71238626cc795 --- /dev/null +++ b/pandas/computation/common.py @@ -0,0 +1 @@ +from pandas.core.computation.common import * diff --git a/pandas/computation/engines.py b/pandas/computation/engines.py new file mode 100644 index 0000000000000..bd6c8b23a9851 --- /dev/null +++ b/pandas/computation/engines.py @@ -0,0 +1 @@ +from pandas.core.computation.engines import * diff --git a/pandas/computation/eval.py b/pandas/computation/eval.py new file mode 100644 index 0000000000000..1442d5d78f48f --- /dev/null +++ b/pandas/computation/eval.py @@ -0,0 +1 @@ +from pandas.core.computation.eval import * diff --git a/pandas/computation/expr.py b/pandas/computation/expr.py new file mode 100644 index 0000000000000..3ce218a0c3383 --- /dev/null +++ b/pandas/computation/expr.py @@ -0,0 +1 @@ +from pandas.core.computation.expr import * diff --git a/pandas/computation/expressions.py b/pandas/computation/expressions.py new file mode 100644 index 0000000000000..63c4dc9ad0ec3 --- /dev/null +++ b/pandas/computation/expressions.py @@ -0,0 +1 @@ +from pandas.core.computation.expressions import * diff --git a/pandas/computation/ops.py b/pandas/computation/ops.py new file mode 100644 index 0000000000000..c8c8a5c1db693 --- /dev/null +++ b/pandas/computation/ops.py @@ -0,0 +1 @@ +from pandas.core.computation.ops import * diff --git a/pandas/computation/pytables.py b/pandas/computation/pytables.py new file mode 100644 index 0000000000000..2aa67a2b6035d --- /dev/null +++ b/pandas/computation/pytables.py @@ -0,0 +1 @@ +from pandas.core.computation.pytables import * diff --git a/pandas/computation/scope.py b/pandas/computation/scope.py new file mode 100644 index 0000000000000..4e073cd8213c2 --- /dev/null +++ b/pandas/computation/scope.py @@ -0,0 +1 @@ +from pandas.core.computation.scope import * diff --git a/pandas/tools/hashing/__init__.py b/pandas/tools/hashing/__init__.py new file mode 100644 index 0000000000000..11c39db47c805 --- /dev/null +++ b/pandas/tools/hashing/__init__.py @@ -0,0 +1,10 @@ +import warnings + + +warnings.warn( + "The pandas.tools.hashimg module is deprecated and will be removed in a " + "future version. Please import from the pandas.util.hashing module instead.", + FutureWarning, stacklevel=2 +) + +from pandas.util.hashing import * diff --git a/pandas/types/__init__.py b/pandas/types/__init__.py new file mode 100644 index 0000000000000..f8253a0bfa08b --- /dev/null +++ b/pandas/types/__init__.py @@ -0,0 +1,8 @@ +import warnings + + +warnings.warn( + "The pandas.types module is deprecated and will be removed in a future " + "version. Please import from the pandas.core.dtypes module instead.", + FutureWarning, stacklevel=2 +) diff --git a/pandas/types/api.py b/pandas/types/api.py new file mode 100644 index 0000000000000..1491534a1e286 --- /dev/null +++ b/pandas/types/api.py @@ -0,0 +1 @@ +from pandas.core.dtypes.api import * diff --git a/pandas/types/cast.py b/pandas/types/cast.py new file mode 100644 index 0000000000000..d3a20f1eca20c --- /dev/null +++ b/pandas/types/cast.py @@ -0,0 +1 @@ +from pandas.core.dtypes.cast import * diff --git a/pandas/types/common.py b/pandas/types/common.py new file mode 100644 index 0000000000000..c1c0970911e47 --- /dev/null +++ b/pandas/types/common.py @@ -0,0 +1 @@ +from pandas.core.dtypes.common import * diff --git a/pandas/types/concat.py b/pandas/types/concat.py new file mode 100644 index 0000000000000..06b37dbeb1edb --- /dev/null +++ b/pandas/types/concat.py @@ -0,0 +1 @@ +from pandas.core.dtypes.concat import * diff --git a/pandas/types/dtypes.py b/pandas/types/dtypes.py new file mode 100644 index 0000000000000..30cea10be0f66 --- /dev/null +++ b/pandas/types/dtypes.py @@ -0,0 +1 @@ +from pandas.core.dtypes.dtypes import * diff --git a/pandas/types/generic.py b/pandas/types/generic.py new file mode 100644 index 0000000000000..25ad11fd923a8 --- /dev/null +++ b/pandas/types/generic.py @@ -0,0 +1 @@ +from pandas.core.dtypes.generic import * diff --git a/pandas/types/inference.py b/pandas/types/inference.py new file mode 100644 index 0000000000000..f26dd605d0619 --- /dev/null +++ b/pandas/types/inference.py @@ -0,0 +1 @@ +from pandas.core.dtypes.inference import * diff --git a/pandas/types/missing.py b/pandas/types/missing.py new file mode 100644 index 0000000000000..908b2fd710493 --- /dev/null +++ b/pandas/types/missing.py @@ -0,0 +1 @@ +from pandas.core.dtypes.missing import *