From cec109b69079dcc683ef22b3ca4819dae2d9c8e9 Mon Sep 17 00:00:00 2001 From: jreback Date: Sat, 7 Sep 2013 10:33:50 -0400 Subject: [PATCH] TST: add dups on both index tests for HDFStore --- pandas/io/pytables.py | 2 +- pandas/io/tests/test_pytables.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py index 0a9e6855f094a..d445ce8b797b5 100644 --- a/pandas/io/pytables.py +++ b/pandas/io/pytables.py @@ -667,7 +667,7 @@ def func(_start, _stop): axis = list(set([t.non_index_axes[0][0] for t in tbls]))[0] # concat and return - return concat(objs, axis=axis, verify_integrity=True).consolidate() + return concat(objs, axis=axis, verify_integrity=False).consolidate() if iterator or chunksize is not None: return TableIterator(self, func, nrows=nrows, start=start, stop=stop, chunksize=chunksize, auto_close=auto_close) diff --git a/pandas/io/tests/test_pytables.py b/pandas/io/tests/test_pytables.py index e9f4cf7d0f96f..48a2150758a3f 100644 --- a/pandas/io/tests/test_pytables.py +++ b/pandas/io/tests/test_pytables.py @@ -2342,6 +2342,16 @@ def test_select_with_dups(self): result = store.select('df',columns=['B','A']) assert_frame_equal(result,expected,by_blocks=True) + # duplicates on both index and columns + with ensure_clean(self.path) as store: + store.append('df',df) + store.append('df',df) + + expected = df.loc[:,['B','A']] + expected = concat([expected, expected]) + result = store.select('df',columns=['B','A']) + assert_frame_equal(result,expected,by_blocks=True) + def test_wide_table_dups(self): wp = tm.makePanel() with ensure_clean(self.path) as store: