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

Method _f_close

tables/table.py:3193–3221  ·  view source on GitHub ↗
(self, flush: bool = True)

Source from the content-addressed store, hash-verified

3191 del mydict["_v_wdflts"]
3192
3193 def _f_close(self, flush: bool = True) -> None:
3194 if not self._v_isopen:
3195 return # the node is already closed
3196
3197 # .. note::
3198 #
3199 # As long as ``Table`` objects access their indices on closing,
3200 # ``File.close()`` will need to make *two separate passes*
3201 # to first close ``Table`` objects and then ``Index`` hierarchies.
3202 #
3203
3204 # Flush right now so the row object does not get in the middle.
3205 if flush:
3206 self.flush()
3207
3208 # Some warnings can be issued after calling `self._g_set_location()`
3209 # in `self.__init__()`. If warnings are turned into exceptions,
3210 # `self._g_post_init_hook` may not be called and `self.cols` not set.
3211 # One example of this is
3212 # ``test_create.createTestCase.test05_maxFieldsExceeded()``.
3213 cols = self.cols
3214 if cols is not None:
3215 cols._g_close()
3216
3217 # Clean address cache
3218 self._clean_chunk_addrs()
3219
3220 # Close myself as a leaf.
3221 super()._f_close(False)
3222
3223 def __repr__(self) -> str:
3224 """Return the string representation of `Table` objects.

Callers

nothing calls this directly

Calls 2

flushMethod · 0.95
_g_closeMethod · 0.45

Tested by

no test coverage detected