Skip to content

Commit 472b93a

Browse files
committed
Merge pull request pandas-dev#4773 from jreback/hdf_dups3
TST: add dups on both index tests for HDFStore
2 parents 38a87b6 + cec109b commit 472b93a

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

pandas/io/pytables.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ def func(_start, _stop):
667667
axis = list(set([t.non_index_axes[0][0] for t in tbls]))[0]
668668

669669
# concat and return
670-
return concat(objs, axis=axis, verify_integrity=True).consolidate()
670+
return concat(objs, axis=axis, verify_integrity=False).consolidate()
671671

672672
if iterator or chunksize is not None:
673673
return TableIterator(self, func, nrows=nrows, start=start, stop=stop, chunksize=chunksize, auto_close=auto_close)

pandas/io/tests/test_pytables.py

+10
Original file line numberDiff line numberDiff line change
@@ -2342,6 +2342,16 @@ def test_select_with_dups(self):
23422342
result = store.select('df',columns=['B','A'])
23432343
assert_frame_equal(result,expected,by_blocks=True)
23442344

2345+
# duplicates on both index and columns
2346+
with ensure_clean(self.path) as store:
2347+
store.append('df',df)
2348+
store.append('df',df)
2349+
2350+
expected = df.loc[:,['B','A']]
2351+
expected = concat([expected, expected])
2352+
result = store.select('df',columns=['B','A'])
2353+
assert_frame_equal(result,expected,by_blocks=True)
2354+
23452355
def test_wide_table_dups(self):
23462356
wp = tm.makePanel()
23472357
with ensure_clean(self.path) as store:

0 commit comments

Comments
 (0)