MCPcopy Create free account
hub / github.com/PyTables/PyTables / create_indexes

Method create_indexes

tables/tests/test_queries.py:264–290  ·  view source on GitHub ↗
(self, colname, ncolname, extracolname)

Source from the content-addressed store, hash-verified

262 condNotBoolean_re = re.compile(r"\bdoes not have a boolean type\b")
263
264 def create_indexes(self, colname, ncolname, extracolname):
265 if not self.indexed:
266 return
267 try:
268 kind = self.kind
269 common.verbosePrint(
270 f"* Indexing ``{colname}`` columns. Type: {kind}."
271 )
272 for acolname in [colname, ncolname, extracolname]:
273 acolumn = self.table.colinstances[acolname]
274 acolumn.create_index(
275 kind=self.kind,
276 optlevel=self.optlevel,
277 _blocksizes=small_blocksizes,
278 _testmode=True,
279 )
280
281 except TypeError as te:
282 if self.colNotIndexable_re.search(str(te)):
283 raise SilentlySkipTest(
284 "Columns of this type can not be indexed."
285 )
286 raise
287 except NotImplementedError:
288 raise SilentlySkipTest(
289 "Indexing columns of this type is not supported yet."
290 )
291
292 def setUp(self):
293 super().setUp()

Callers 1

test_methodFunction · 0.80

Calls 3

SilentlySkipTestClass · 0.85
create_indexMethod · 0.80
searchMethod · 0.80

Tested by

no test coverage detected