Skip to content

Commit 20ffb69

Browse files
committed
testing for PyTables 2.3 was incorrect (for allowing indexing support); added test to catch
1 parent 94bd4e7 commit 20ffb69

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

pandas/io/pytables.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868

6969
# oh the troubles to reduce import time
7070
_table_mod = None
71-
_table_supports_index = True
71+
_table_supports_index = False
7272

7373
def _tables():
7474
global _table_mod
@@ -79,7 +79,7 @@ def _tables():
7979

8080
# version requirements
8181
major, minor, subv = tables.__version__.split('.')
82-
if major >= 2 and minor >= 3:
82+
if int(major) >= 2 and int(minor) >= 3:
8383
_table_supports_index = True
8484

8585
return _table_mod

pandas/io/tests/test_pytables.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,11 @@ def test_create_table_index(self):
184184
self.store.put('f2', df)
185185
self.assertRaises(Exception, self.store.create_table_index, 'f2')
186186

187+
# try to change the version supports flag
188+
from pandas.io import pytables
189+
pytables._table_supports_index = False
190+
self.assertRaises(Exception, self.store.create_table_index, 'f')
191+
187192
def test_append_diff_item_order(self):
188193
wp = tm.makePanel()
189194
wp1 = wp.ix[:, :10, :]

0 commit comments

Comments
 (0)