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

Method _reindex

tables/table.py:2926–2941  ·  view source on GitHub ↗

Re-index columns in `colnames` if automatic indexing is true.

(self, colnames: list[str])

Source from the content-addressed store, hash-verified

2924 col.index.dirty = True
2925
2926 def _reindex(self, colnames: list[str]) -> None:
2927 """Re-index columns in `colnames` if automatic indexing is true."""
2928 if self.indexed:
2929 colindexed, cols = self.colindexed, self.cols
2930 colstoindex = []
2931 # Mark the proper indexes as dirty
2932 for colname in colnames:
2933 if colindexed[colname]:
2934 col = cols._g_col(colname)
2935 col.index.dirty = True
2936 colstoindex.append(colname)
2937 # Now, re-index the dirty ones
2938 if self.autoindex and colstoindex:
2939 self._do_reindex(dirty=True)
2940 # The table caches for indexed queries are dirty now
2941 self._dirtycache = True
2942
2943 def _do_reindex(self, dirty: bool) -> int:
2944 """Execute common code for `reindex()` and `reindex_dirty()`."""

Callers 5

modify_coordinatesMethod · 0.95
modify_rowsMethod · 0.95
modify_columnMethod · 0.95
modify_columnsMethod · 0.95
remove_rowsMethod · 0.95

Calls 3

_do_reindexMethod · 0.95
_g_colMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected