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

Method _get_column_instance

tables/table.py:1196–1211  ·  view source on GitHub ↗

Get the instance of the column with the given `colpathname`. If the column does not exist in the table, a `KeyError` is raised.

(self, colpathname: str)

Source from the content-addressed store, hash-verified

1194 self._v_dtype = self.description._v_dtype
1195
1196 def _get_column_instance(self, colpathname: str):
1197 """Get the instance of the column with the given `colpathname`.
1198
1199 If the column does not exist in the table, a `KeyError` is
1200 raised.
1201
1202 """
1203 try:
1204 return functools.reduce(
1205 getattr, colpathname.split("/"), self.description
1206 )
1207 except AttributeError:
1208 raise KeyError(
1209 "table ``%s`` does not have a column named ``%s``"
1210 % (self._v_pathname, colpathname)
1211 )
1212
1213 _check_column = _get_column_instance
1214

Callers 2

modify_columnMethod · 0.95
modify_columnsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected