-
Notifications
You must be signed in to change notification settings - Fork 7
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(bc): correct case sensitivity for binding constraint term IDs #1903
fix(bc): correct case sensitivity for binding constraint term IDs #1903
Conversation
28b9823
to
0f6db4e
Compare
0f6db4e
to
aa63fba
Compare
tests/integration/study_data_blueprint/test_binding_constraints.py
Outdated
Show resolved
Hide resolved
tests/integration/study_data_blueprint/test_binding_constraints.py
Outdated
Show resolved
Hide resolved
tests/integration/study_data_blueprint/test_binding_constraints.py
Outdated
Show resolved
Hide resolved
tests/integration/study_data_blueprint/test_binding_constraints.py
Outdated
Show resolved
Hide resolved
tests/integration/study_data_blueprint/test_binding_constraints.py
Outdated
Show resolved
Hide resolved
tests/integration/study_data_blueprint/test_binding_constraints.py
Outdated
Show resolved
Hide resolved
221b2a8
to
075c39a
Compare
075c39a
to
3190cf1
Compare
3190cf1
to
29f0fb8
Compare
This comment was marked as resolved.
This comment was marked as resolved.
d2a1244
to
6f51372
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Il y a un breaking change sur l'API
tests/integration/study_data_blueprint/test_binding_constraints.py
Outdated
Show resolved
Hide resolved
tests/integration/study_data_blueprint/test_binding_constraints.py
Outdated
Show resolved
Hide resolved
raise ConstraintIdNotFoundError(study.id) | ||
|
||
data_term_index = BindingConstraintManager.find_constraint_term_id(constraints, data_id) | ||
if data_term_index < 0: | ||
term_id_index = BindingConstraintManager.find_constraint_term_id(constraint_terms, term_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
En fait, ici le code est moche car on fait une recherche d'index dans une liste. Tout serait plus simple si on avait un dict
…
constraint_map = {term.id: term for term in constraint_terms}
...
if term_id in constraint_map:
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
je suis d'accord, c'est mieux, mon but ici n'était pas de faire un gros refactoring. je veux bien m'en occuper quand on fera une refonte du front
antarest/study/storage/variantstudy/business/utils_binding_constraint.py
Show resolved
Hide resolved
6f51372
to
c7184d8
Compare
c7184d8
to
b599f09
Compare
Description
This PR introduces changes to ensure consistent handling of case sensitivity in binding constraint term IDs across the backend and frontend. It also includes additional tests to validate this behavior.
Backend
Updated the
update_constraint_term
function, to handle term IDs in a case-insensitive manner. This ensures that term IDs are processed consistently, regardless of their case.Modified ID comparisons and processing logic to use lowercase versions of term IDs, aligning with the frontend changes for uniformity and reducing the likelihood of mismatches due to case differences.
Frontend
In the
OptionsList
component, normalized the cluster IDs to lowercase. This change allow the frontend to display clusters names for BC terms regardless of their ID case.