Skip to content

[FIX] table: Update ids in Table.__del__#2470

Merged
astaric merged 1 commit intobiolab:masterfrom
ales-erjavec:fixes/table-del-ids
Jul 14, 2017
Merged

[FIX] table: Update ids in Table.__del__#2470
astaric merged 1 commit intobiolab:masterfrom
ales-erjavec:fixes/table-del-ids

Conversation

@ales-erjavec
Copy link
Contributor

Issue
import Orange.data
d = Orange.data.Table("iris")
del d[2:]
d[[True, False]]

fails with

Traceback (most recent call last):
  File "<stdin>", line 4, in <module>
  File "/Users/aleserjavec/workspace/orange3/Orange/data/table.py", line 694, in __getitem__
    return self.from_table_rows(self, key)
  File "/Users/aleserjavec/workspace/orange3/Orange/data/table.py", line 449, in from_table_rows
    self.ids = np.array(source.ids[row_indices])
IndexError: boolean index did not match indexed array along dimension 0; dimension is 150 but corresponding boolean dimension is 2
Description of changes

Update ids in Table.__del__

Includes
  • Code changes
  • Tests
  • Documentation

Would later fail on table indexing with a boolean mask array.
@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (master@aabdccd). Click here to learn what that means.
The diff coverage is 100%.

@@           Coverage Diff            @@
##             master   #2470   +/-   ##
========================================
  Coverage          ?   74.3%           
========================================
  Files             ?     321           
  Lines             ?   56022           
  Branches          ?       0           
========================================
  Hits              ?   41626           
  Misses            ?   14396           
  Partials          ?       0

@astaric astaric merged commit 2aa859b into biolab:master Jul 14, 2017
@ales-erjavec ales-erjavec deleted the fixes/table-del-ids branch November 14, 2017 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants