Flush the table buffers.
(self)
| 3129 | ) |
| 3130 | |
| 3131 | def flush(self) -> None: |
| 3132 | """Flush the table buffers.""" |
| 3133 | if self._v_file._iswritable(): |
| 3134 | # Flush rows that remains to be appended |
| 3135 | if "row" in self.__dict__: |
| 3136 | self.row._flush_buffered_rows() |
| 3137 | if self.indexed and self.autoindex: |
| 3138 | # Flush any unindexed row |
| 3139 | rowsadded = self.flush_rows_to_index(_lastrow=True) |
| 3140 | assert rowsadded <= 0 or self._indexedrows == self.nrows, ( |
| 3141 | "internal error: the number of indexed rows (%d) " |
| 3142 | "and rows in the table (%d) is not equal; " |
| 3143 | "please report this to the authors." |
| 3144 | % (self._indexedrows, self.nrows) |
| 3145 | ) |
| 3146 | if self._dirtyindexes: |
| 3147 | # Finally, re-index any dirty column |
| 3148 | self.reindex_dirty() |
| 3149 | |
| 3150 | super().flush() |
| 3151 | |
| 3152 | def _g_pre_kill_hook(self) -> None: |
| 3153 | """Code to be called before killing the node.""" |
no test coverage detected