Skip to content

Commit

Permalink
Corpus - Remove attribute copying
Browse files Browse the repository at this point in the history
  • Loading branch information
PrimozGodec committed Jan 12, 2024
1 parent 02b1892 commit 35c3dc8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
4 changes: 0 additions & 4 deletions orangecontrib/text/corpus.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,8 +544,6 @@ def from_table(cls, domain, source, row_indices=...):
c = super().from_table(domain, source, row_indices)
c._setup_corpus()
Corpus.retain_preprocessing(source, c, row_indices)
# temp fix: remove when oldest Orange >= 3.34
c.attributes = deepcopy(c.attributes)
return c

@classmethod
Expand Down Expand Up @@ -587,8 +585,6 @@ def from_table_rows(cls, source, row_indices):
if hasattr(source, "_titles"):
# covering case when from_table_rows called by from_table
c._titles = source._titles[row_indices]
# temp fix: remove when oldest Orange >= 3.34
c.attributes = deepcopy(c.attributes)
return c

@classmethod
Expand Down
14 changes: 0 additions & 14 deletions orangecontrib/text/tests/test_corpus.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,20 +671,6 @@ def test_language_copied(self):
self.assertEqual(new_corpus.language, "sl")
self.assertEqual(corpus.language, "en")

def test_remove_attributes_copy(self):
"""
Happy new year!
We added a deepcopy of attributes to from_table and from_table_rows
since Orange didn't copy attributes. It should be removed when oldest
supported Orange is 3.34 or higher.
When test starts to fail:
- remove it
- remove copying of attributes in from_table and from_table_rows
- update Orange version to >=3.34 if not done yet
"""
self.assertLess(datetime.today(), datetime(2024, 1, 1))

def test_language_unpickle(self):
path = os.path.dirname(__file__)
file = os.path.abspath(os.path.join(path, "data", "book-excerpts.pkl"))
Expand Down

0 comments on commit 35c3dc8

Please sign in to comment.