Skip to content

Commit d3b48a8

Browse files
committed
Merge pull request #5009 from jreback/remove_io_deprecate
API: Remove deprecated read_clipboard/to_clipboard/ExcelFile/ExcelWriter from pandas.io.parsers (GH3717)
2 parents 855d3d7 + 96dd0b8 commit d3b48a8

File tree

5 files changed

+16
-50
lines changed

5 files changed

+16
-50
lines changed

doc/source/api.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ Flat File
3131
read_table
3232
read_csv
3333
read_fwf
34+
35+
Clipboard
36+
~~~~~~~~~
37+
38+
.. currentmodule:: pandas.io.clipboard
39+
40+
.. autosummary::
41+
:toctree: generated/
42+
3443
read_clipboard
3544

3645
Excel

doc/source/install.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Optional Dependencies
111111
<http://www.pygtk.org/>`__, `xsel
112112
<http://www.vergenet.net/~conrad/software/xsel/>`__, or `xclip
113113
<http://sourceforge.net/projects/xclip/>`__: necessary to use
114-
:func:`~pandas.io.parsers.read_clipboard`. Most package managers on Linux
114+
:func:`~pandas.io.clipboard.read_clipboard`. Most package managers on Linux
115115
distributions will have xclip and/or xsel immediately available for
116116
installation.
117117
* One of the following combinations of libraries is needed to use the

doc/source/release.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ API Changes
245245
- Remove deprecated ``_verbose_info`` (:issue:`3215`)
246246
- Begin removing methods that don't make sense on ``GroupBy`` objects
247247
(:issue:`4887`).
248+
- Remove deprecated ``read_clipboard/to_clipboard/ExcelFile/ExcelWriter`` from ``pandas.io.parsers`` (:issue:`3717`)
248249

249250
Internal Refactoring
250251
~~~~~~~~~~~~~~~~~~~~

pandas/io/parsers.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2048,27 +2048,3 @@ def __init__(self, f, **kwds):
20482048
def _make_reader(self, f):
20492049
self.data = FixedWidthReader(f, self.colspecs, self.delimiter,
20502050
encoding=self.encoding)
2051-
2052-
2053-
##### deprecations in 0.12 #####
2054-
##### remove in 0.12 #####
2055-
2056-
from pandas.io import clipboard
2057-
def read_clipboard(**kwargs):
2058-
warn("read_clipboard is now a top-level accessible via pandas.read_clipboard", FutureWarning)
2059-
clipboard.read_clipboard(**kwargs)
2060-
2061-
def to_clipboard(obj):
2062-
warn("to_clipboard is now an object level method accessible via obj.to_clipboard()", FutureWarning)
2063-
clipboard.to_clipboard(obj)
2064-
2065-
from pandas.io import excel
2066-
class ExcelWriter(excel.ExcelWriter):
2067-
def __init__(self, path):
2068-
warn("ExcelWriter can now be imported from: pandas.io.excel", FutureWarning)
2069-
super(ExcelWriter, self).__init__(path)
2070-
2071-
class ExcelFile(excel.ExcelFile):
2072-
def __init__(self, path_or_buf, **kwds):
2073-
warn("ExcelFile can now be imported from: pandas.io.excel", FutureWarning)
2074-
super(ExcelFile, self).__init__(path_or_buf, **kwds)

pandas/io/tests/test_excel.py

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -254,20 +254,20 @@ def test_excel_read_buffer(self):
254254
f = open(pth, 'rb')
255255
xl = ExcelFile(f)
256256
xl.parse('Sheet1', index_col=0, parse_dates=True)
257-
257+
258258
def test_read_xlrd_Book(self):
259259
_skip_if_no_xlrd()
260260
_skip_if_no_xlwt()
261-
261+
262262
import xlrd
263-
263+
264264
pth = '__tmp_excel_read_worksheet__.xls'
265265
df = self.frame
266-
266+
267267
with ensure_clean(pth) as pth:
268268
df.to_excel(pth, "SheetA")
269269
book = xlrd.open_workbook(pth)
270-
270+
271271
with ExcelFile(book, engine="xlrd") as xl:
272272
result = xl.parse("SheetA")
273273
tm.assert_frame_equal(df, result)
@@ -1004,26 +1004,6 @@ def check_called(func):
10041004
check_called(lambda: df.to_excel('something.xls', engine='dummy'))
10051005
set_option('io.excel.xlsx.writer', val)
10061006

1007-
1008-
class ExcelLegacyTests(SharedItems, unittest.TestCase):
1009-
def test_deprecated_from_parsers(self):
1010-
1011-
# since 0.12 changed the import path
1012-
import warnings
1013-
1014-
with warnings.catch_warnings():
1015-
warnings.filterwarnings(action='ignore', category=FutureWarning)
1016-
1017-
_skip_if_no_xlrd()
1018-
from pandas.io.parsers import ExcelFile as xf
1019-
xf(self.xls1)
1020-
1021-
_skip_if_no_xlwt()
1022-
with ensure_clean('test.xls') as path:
1023-
from pandas.io.parsers import ExcelWriter as xw
1024-
xw(path)
1025-
1026-
10271007
if __name__ == '__main__':
10281008
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
10291009
exit=False)

0 commit comments

Comments
 (0)