Skip to content

Commit

Permalink
table.attributes are always referenced in transformations
Browse files Browse the repository at this point in the history
  • Loading branch information
markotoplak committed Jul 8, 2024
1 parent d7634aa commit 4460fbb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Orange/data/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -835,8 +835,9 @@ def from_table(cls, domain, source, row_indices=...):
self.W = source.W[row_indices]
self.name = getattr(source, 'name', '')
self.ids = source.ids[row_indices]
self.attributes = getattr(source, 'attributes', {})
if new_cache: # only deepcopy attributes for the outermost transformation
self.attributes = deepcopy(getattr(source, 'attributes', {}))
self.attributes = deepcopy(self.attributes)
_idcache_save(_thread_local.conversion_cache, (domain, source), self)
return self
finally:
Expand Down Expand Up @@ -895,8 +896,9 @@ def from_table_rows(cls, source, row_indices):
self.W = source.W[row_indices]
self.name = getattr(source, 'name', '')
self.ids = source.ids[row_indices]
self.attributes = getattr(source, 'attributes', {})
if is_outermost_transformation:
self.attributes = deepcopy(getattr(source, 'attributes', {}))
self.attributes = deepcopy(self.attributes)
return self

@classmethod
Expand Down

0 comments on commit 4460fbb

Please sign in to comment.