Skip to content

Commit

Permalink
Fix instantiated splitting of uninstantiated columns
Browse files Browse the repository at this point in the history
  • Loading branch information
smathot committed May 10, 2023
1 parent b836523 commit d630374
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion datamatrix/_datamatrix/_datamatrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ def _selectrowid(self, _rowid):
# By default we create new columns with a copy of the selected data
if not hasattr(self, '_instantiate_on_select') or \
self._instantiate_on_select:
self._instantiate_column(name)
dm._cols[name] = self._cols[name]._getrowidkey(_rowid, dm)
# Except when _instatiate_on_select is set to False, in which case
# we create an UninstantiatedColumn object which can be turned into
Expand Down Expand Up @@ -899,10 +900,12 @@ def _instantiate(self):
col = col.instantiate()
self._cols[name] = col

def _instantiate_column(self, key, col):
def _instantiate_column(self, key, col=None):
"""Makes sure that a specific column is instantiated, and returns the
instantiated column.
"""
if col is None:
col = self._cols[key]
if not isinstance(col, UninstantiatedColumn):
return col
col = col.instantiate()
Expand Down

0 comments on commit d630374

Please sign in to comment.