Skip to content

Commit 5516aa4

Browse files
committed
Added deprecation warning and shim
1 parent 72fd351 commit 5516aa4

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

pandas/formats/__init__.py

Whitespace-only changes.

pandas/formats/style.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import warnings
2+
3+
warnings.warn("Styler has been moved from pandas.formats.style.Styler"
4+
" to pandas.io.formats.style.Styler. This shim will be"
5+
" removed in pandas 0.21",
6+
FutureWarning)
7+
from pandas.io.formats.style import Styler # noqa

pandas/tests/io/formats/test_style.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -747,3 +747,10 @@ def test_from_custom_template(tmpdir):
747747
assert result.template is not Styler.template
748748
styler = result(pd.DataFrame({"A": [1, 2]}))
749749
assert styler.render()
750+
751+
752+
def test_shim():
753+
# https://github.com/pandas-dev/pandas/pull/16059
754+
# Remove in 0.21
755+
with pytest.warns(FutureWarning):
756+
from pandas.formats.style import Styler as _styler # noqa

0 commit comments

Comments
 (0)