Skip to content

Commit a39e4a5

Browse files
h-vetinariPingviinituutti
authored andcommitted
TST: Fix pytables test (pandas-dev#23732)
1 parent 4b5c9c8 commit a39e4a5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pandas/tests/io/test_pytables.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -4756,24 +4756,26 @@ def test_categorical(self):
47564756
tm.assert_series_equal(s, result)
47574757

47584758
_maybe_remove(store, 'df')
4759-
47604759
df = DataFrame({"s": s, "vals": [1, 2, 3, 4, 5, 6]})
47614760
store.append('df', df, format='table')
47624761
result = store.select('df')
47634762
tm.assert_frame_equal(result, df)
47644763

47654764
# Dtypes
4765+
_maybe_remove(store, 'si')
47664766
s = Series([1, 1, 2, 2, 3, 4, 5]).astype('category')
47674767
store.append('si', s)
47684768
result = store.select('si')
47694769
tm.assert_series_equal(result, s)
47704770

4771+
_maybe_remove(store, 'si2')
47714772
s = Series([1, 1, np.nan, 2, 3, 4, 5]).astype('category')
47724773
store.append('si2', s)
47734774
result = store.select('si2')
47744775
tm.assert_series_equal(result, s)
47754776

47764777
# Multiple
4778+
_maybe_remove(store, 'df2')
47774779
df2 = df.copy()
47784780
df2['s2'] = Series(list('abcdefg')).astype('category')
47794781
store.append('df2', df2)
@@ -4787,13 +4789,15 @@ def test_categorical(self):
47874789
assert '/df2/meta/values_block_1/meta' in info
47884790

47894791
# unordered
4792+
_maybe_remove(store, 's2')
47904793
s = Series(Categorical(['a', 'b', 'b', 'a', 'a', 'c'], categories=[
47914794
'a', 'b', 'c', 'd'], ordered=False))
47924795
store.append('s2', s, format='table')
47934796
result = store.select('s2')
47944797
tm.assert_series_equal(result, s)
47954798

47964799
# Query
4800+
_maybe_remove(store, 'df3')
47974801
store.append('df3', df, data_columns=['s'])
47984802
expected = df[df.s.isin(['b', 'c'])]
47994803
result = store.select('df3', where=['s in ["b","c"]'])

0 commit comments

Comments
 (0)