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

Method _do_reindex

tables/table.py:2943–2955  ·  view source on GitHub ↗

Execute common code for `reindex()` and `reindex_dirty()`.

(self, dirty: bool)

Source from the content-addressed store, hash-verified

2941 self._dirtycache = True
2942
2943 def _do_reindex(self, dirty: bool) -> int:
2944 """Execute common code for `reindex()` and `reindex_dirty()`."""
2945 indexedrows = 0
2946 for colname, colindexed in self.colindexed.items():
2947 if colindexed:
2948 indexcol = self.cols._g_col(colname)
2949 indexedrows = indexcol._do_reindex(dirty)
2950 # Update counters in case some column has been updated
2951 if indexedrows > 0:
2952 self._indexedrows = indexedrows
2953 self._unsaved_indexedrows = self.nrows - indexedrows
2954
2955 return SizeType(indexedrows)
2956
2957 def reindex(self) -> None:
2958 """Recompute all the existing indexes in the table.

Callers 3

_reindexMethod · 0.95
reindexMethod · 0.95
reindex_dirtyMethod · 0.95

Calls 2

_g_colMethod · 0.80
itemsMethod · 0.45

Tested by

no test coverage detected