Skip to content

Commit 365f2fe

Browse files
topper-123jowens
authored andcommitted
TST: remove tests and docs for legacy (pre 0.12) hdf5 support (pandas-dev#17404)
1 parent 3a0dc92 commit 365f2fe

File tree

5 files changed

+3
-71
lines changed

5 files changed

+3
-71
lines changed

doc/source/io.rst

-38
Original file line numberDiff line numberDiff line change
@@ -4419,44 +4419,6 @@ Now you can import the ``DataFrame`` into R:
44194419
starting point if you have stored multiple ``DataFrame`` objects to a
44204420
single HDF5 file.
44214421

4422-
Backwards Compatibility
4423-
'''''''''''''''''''''''
4424-
4425-
0.10.1 of ``HDFStore`` can read tables created in a prior version of pandas,
4426-
however query terms using the
4427-
prior (undocumented) methodology are unsupported. ``HDFStore`` will
4428-
issue a warning if you try to use a legacy-format file. You must
4429-
read in the entire file and write it out using the new format, using the
4430-
method ``copy`` to take advantage of the updates. The group attribute
4431-
``pandas_version`` contains the version information. ``copy`` takes a
4432-
number of options, please see the docstring.
4433-
4434-
4435-
.. ipython:: python
4436-
:suppress:
4437-
4438-
import os
4439-
legacy_file_path = os.path.abspath('source/_static/legacy_0.10.h5')
4440-
4441-
.. ipython:: python
4442-
:okwarning:
4443-
4444-
# a legacy store
4445-
legacy_store = pd.HDFStore(legacy_file_path,'r')
4446-
legacy_store
4447-
4448-
# copy (and return the new handle)
4449-
new_store = legacy_store.copy('store_new.h5')
4450-
new_store
4451-
new_store.close()
4452-
4453-
.. ipython:: python
4454-
:suppress:
4455-
4456-
legacy_store.close()
4457-
import os
4458-
os.remove('store_new.h5')
4459-
44604422

44614423
Performance
44624424
'''''''''''

doc/source/whatsnew/v0.21.0.txt

+2
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,8 @@ Removal of prior version deprecations/changes
372372
- ``Categorical`` has dropped the ``.order()`` and ``.sort()`` methods in favor of ``.sort_values()`` (:issue:`12882`)
373373
- :func:`eval` and :func:`DataFrame.eval` have changed the default of ``inplace`` from ``None`` to ``False`` (:issue:`11149`)
374374
- The function ``get_offset_name`` has been dropped in favor of the ``.freqstr`` attribute for an offset (:issue:`11834`)
375+
- pandas no longer tests for compatibility with hdf5-files created with pandas < 0.11 (:issue:`17404`).
376+
375377

376378

377379
.. _whatsnew_0210.performance:
-233 KB
Binary file not shown.
Binary file not shown.

pandas/tests/io/test_pytables.py

+1-33
Original file line numberDiff line numberDiff line change
@@ -4599,41 +4599,13 @@ def test_legacy_table_read(self):
45994599
expected = df2[df2.index > df2.index[2]]
46004600
assert_frame_equal(expected, result)
46014601

4602-
def test_legacy_0_10_read(self):
4603-
# legacy from 0.10
4604-
with catch_warnings(record=True):
4605-
path = tm.get_data_path('legacy_hdf/legacy_0.10.h5')
4606-
with ensure_clean_store(path, mode='r') as store:
4607-
str(store)
4608-
for k in store.keys():
4609-
store.select(k)
4610-
4611-
def test_legacy_0_11_read(self):
4612-
# legacy from 0.11
4613-
path = os.path.join('legacy_hdf', 'legacy_table_0.11.h5')
4614-
with ensure_clean_store(tm.get_data_path(path), mode='r') as store:
4615-
str(store)
4616-
assert 'df' in store
4617-
assert 'df1' in store
4618-
assert 'mi' in store
4619-
df = store.select('df')
4620-
df1 = store.select('df1')
4621-
mi = store.select('mi')
4622-
assert isinstance(df, DataFrame)
4623-
assert isinstance(df1, DataFrame)
4624-
assert isinstance(mi, DataFrame)
4625-
46264602
def test_copy(self):
46274603

46284604
with catch_warnings(record=True):
46294605

4630-
def do_copy(f=None, new_f=None, keys=None,
4606+
def do_copy(f, new_f=None, keys=None,
46314607
propindexes=True, **kwargs):
46324608
try:
4633-
if f is None:
4634-
f = tm.get_data_path(os.path.join('legacy_hdf',
4635-
'legacy_0.10.h5'))
4636-
46374609
store = HDFStore(f, 'r')
46384610

46394611
if new_f is None:
@@ -4671,10 +4643,6 @@ def do_copy(f=None, new_f=None, keys=None,
46714643
pass
46724644
safe_remove(new_f)
46734645

4674-
do_copy()
4675-
do_copy(keys=['/a', '/b', '/df1_mixed'])
4676-
do_copy(propindexes=False)
4677-
46784646
# new table
46794647
df = tm.makeDataFrame()
46804648

0 commit comments

Comments
 (0)