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

Function add_expr

tables/conditions.py:303–315  ·  view source on GitHub ↗

Add a single expression to the list.

(expr, idxexprs: list, strexpr: list[str])

Source from the content-addressed store, hash-verified

301 rexpr = _get_idx_expr_recurse(right, indexedcols, idxexprs, strexpr)
302
303 def add_expr(expr, idxexprs: list, strexpr: list[str]) -> None:
304 """Add a single expression to the list."""
305 if isinstance(expr, list):
306 # expr is a single expression
307 idxexprs.append(expr[0])
308 lenexprs = len(idxexprs)
309 # Mutate the strexpr string
310 if lenexprs == 1:
311 strexpr[:] = ["e0"]
312 else:
313 strexpr[:] = [
314 "(%s %s e%d)" % (strexpr[0], op_conv[op], lenexprs - 1)
315 ]
316
317 # Add expressions to the indexable list when they are and'ed, or
318 # they are both indexable.

Callers 1

_get_idx_expr_recurseFunction · 0.85

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected