Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] tableview: Fix errors with sparse basket columns #6409

Merged
merged 3 commits into from
Apr 14, 2023

Conversation

ales-erjavec
Copy link
Contributor

Issue

Since #6370 errors appear in data table when a sparse basket column in on input.

When clicking 'Show variable labels':

Traceback (most recent call last):
  File "/home/ales/devel/orange3/Orange/widgets/data/utils/tableview.py", line 175, in __headerDataChanged
    text += "\n".join(key for key, _ in items)
  File "/home/ales/devel/orange3/Orange/widgets/data/utils/tableview.py", line 175, in <genexpr>
    text += "\n".join(key for key, _ in items)
ValueError: not enough values to unpack (expected 2, got 1)

When trying to sort a basket column:

Traceback (most recent call last):
  File "/home/ales/devel/orange3/Orange/widgets/data/owtable.py", line 341, in _on_sort_indicator_changed
    self.stored_sort.append((var.name, order))
AttributeError: 'NoneType' object has no attribute 'name'

Description of changes

Fix errors in handling sparse basket column in tableview.

Includes
  • Code changes
  • Tests
  • Documentation

@janezd janezd added this to the 3.35.0 milestone Apr 14, 2023
@ales-erjavec ales-erjavec changed the title [FIX] tableview: Fix errors wtih sparse basket columns [FIX] tableview: Fix errors with sparse basket columns Apr 14, 2023
@VesnaT
Copy link
Contributor

VesnaT commented Apr 14, 2023

I can temporarily merge this to avoid the crash, but I don't agree with the solution.
The table could be sortable by Y or metas even though it has sparse X.

@markotoplak
Copy link
Member

To me, this seems like removing a feature (being able to sort such table on metas) for the occasional, user-avoidable :) bug. In such cases, I prefer buggy features to no features.

@ales-erjavec ales-erjavec force-pushed the fixes/tableview-sparse branch from 40bbdad to 68d95b0 Compare April 14, 2023 11:45
@codecov
Copy link

codecov bot commented Apr 14, 2023

Codecov Report

Merging #6409 (68d95b0) into master (1056fc3) will increase coverage by 0.01%.
The diff coverage is 87.87%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6409      +/-   ##
==========================================
+ Coverage   87.61%   87.62%   +0.01%     
==========================================
  Files         321      321              
  Lines       69024    69056      +32     
==========================================
+ Hits        60476    60511      +35     
+ Misses       8548     8545       -3     

@VesnaT VesnaT merged commit 74f83d4 into biolab:master Apr 14, 2023
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.

4 participants