Skip to content

Commit cd85140

Browse files
committed
BLD: add support for pytables 3.1
BLD: update 3.3 build for numexpr 2.3
1 parent 7b0317e commit cd85140

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

ci/requirements-3.3.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ xlrd==0.9.2
66
html5lib==1.0b2
77
numpy==1.8.0
88
cython==0.19.1
9-
numexpr==2.1
10-
tables==3.0.0
9+
numexpr==2.3
10+
tables==3.1.0
1111
matplotlib==1.2.1
1212
patsy==0.1.0
1313
lxml==3.2.1

pandas/io/tests/test_pytables.py

+21-1
Original file line numberDiff line numberDiff line change
@@ -1449,7 +1449,7 @@ def col(t,column):
14491449
tables.__version__ = v
14501450
self.assertRaises(Exception, store.create_table_index, 'f')
14511451

1452-
for v in ['2.3.1', '2.3.1b', '2.4dev', '2.4', original]:
1452+
for v in ['2.3.1', '2.3.1b', '2.4dev', '2.4', '3.0.0', '3.1.0', original]:
14531453
pytables._table_mod = None
14541454
pytables._table_supports_index = False
14551455
tables.__version__ = v
@@ -3732,6 +3732,26 @@ def test_select_as_multiple(self):
37323732
self.assertRaises(ValueError, store.select_as_multiple,
37333733
['df1','df3'], where=['A>0', 'B>0'], selector='df1')
37343734

3735+
3736+
def test_nan_selection_bug_4858(self):
3737+
3738+
# GH 4858; nan selection bug, only works for pytables >= 3.1
3739+
if LooseVersion(tables.__version__) < '3.1.0':
3740+
raise nose.SkipTest('tables version does not support fix for nan selection bug: GH 4858')
3741+
3742+
with ensure_clean_store(self.path) as store:
3743+
3744+
df = DataFrame(dict(cols = range(6), values = range(6)), dtype='float64')
3745+
df['cols'] = (df['cols']+10).apply(str)
3746+
df.iloc[0] = np.nan
3747+
3748+
expected = DataFrame(dict(cols = ['13.0','14.0','15.0'], values = [3.,4.,5.]), index=[3,4,5])
3749+
3750+
# write w/o the index on that particular column
3751+
store.append('df',df, data_columns=True,index=['cols'])
3752+
result = store.select('df',where='values>2.0')
3753+
assert_frame_equal(result,expected)
3754+
37353755
def test_start_stop(self):
37363756

37373757
with ensure_clean_store(self.path) as store:

0 commit comments

Comments
 (0)