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

do not allow selection to contain duplicates #489

Merged
merged 3 commits into from
Jun 17, 2024
Merged

Conversation

PythonFZ
Copy link
Member

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Jun 15, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 49.70%. Comparing base (d61512a) to head (b3ccd0c).

Files Patch % Lines
tests/test_selection.py 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #489      +/-   ##
==========================================
- Coverage   50.19%   49.70%   -0.50%     
==========================================
  Files          26       26              
  Lines        2002     2010       +8     
==========================================
- Hits         1005      999       -6     
- Misses        997     1011      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@PythonFZ PythonFZ requested a review from RokasEl June 16, 2024 08:24
Copy link
Collaborator

@RokasEl RokasEl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't you just filter duplicates in the selection rather than raising a ValueError?

@PythonFZ
Copy link
Member Author

Why don't you just filter duplicates in the selection rather than raising a ValueError?

My motivation was, to let the user know that duplicates will not be possible. When filtering them silently e.g. via list(set(...)), they will not notice that something might be wrong.

@RokasEl
Copy link
Collaborator

RokasEl commented Jun 17, 2024

Perhaps throw a warning instead? My worry is that something might happen in the webclient to accidentally cause a double selection. We don't want value errors thrown around in that case.

@PythonFZ
Copy link
Member Author

Perhaps throw a warning instead? My worry is that something might happen in the webclient to accidentally cause a double selection. We don't want value errors thrown around in that case.

The webclient uses a set for selection, so it should not be possible to cause any issue there:

const [selectedIds, setSelectedIds] = useState<Set<number>>(new Set());

@RokasEl
Copy link
Collaborator

RokasEl commented Jun 17, 2024

In which case I think this is fine to merge.

@PythonFZ PythonFZ merged commit acdf27d into main Jun 17, 2024
4 checks passed
@PythonFZ PythonFZ deleted the test-duplicate-selection branch June 17, 2024 13:24
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