diff --git a/antarest/study/business/binding_constraint_management.py b/antarest/study/business/binding_constraint_management.py index 181fbb5c07..94a9da9ddf 100644 --- a/antarest/study/business/binding_constraint_management.py +++ b/antarest/study/business/binding_constraint_management.py @@ -391,7 +391,7 @@ def parse_constraint(key: str, value: str, char: str, new_config: ConstraintOutp return False @staticmethod - def constraint_model_adapter(constraint: ConstraintInput, version: int) -> ConstraintOutput: + def constraint_model_adapter(constraint: Mapping[str, Any], version: int) -> ConstraintOutput: """ Adapts a constraint configuration to the appropriate version-specific format. @@ -479,7 +479,7 @@ def get_binding_constraint( # If a specific constraint ID is provided, we return that constraint if filters.bc_id: - return filtered_constraints.get(filters.bc_id) + return filtered_constraints.get(filters.bc_id) #type: ignore # Else we return all the matching constraints, based on the given filters return list(filtered_constraints.values()) @@ -677,7 +677,7 @@ def update_binding_constraint( } if study_version >= 870: - updated_constraint["group"] = data.group or existing_constraint.group + updated_constraint["group"] = data.group or existing_constraint.group #type: ignore args = { **updated_constraint, @@ -740,7 +740,7 @@ def update_constraint_term( if not isinstance(constraint, ConstraintOutputBase) and not isinstance(constraint, ConstraintOutputBase): raise BindingConstraintNotFoundError(study.id) - + constraint_terms = constraint.terms # existing constraint terms if constraint_terms is None: raise NoConstraintError(study.id) @@ -836,7 +836,7 @@ def remove_constraint_term( binding_constraint_id: str, term_id: str, ) -> None: - return self.update_constraint_term(study, binding_constraint_id, term_id) + return self.update_constraint_term(study, binding_constraint_id, term_id) #type: ignore def _replace_matrices_according_to_frequency_and_version( diff --git a/antarest/study/business/table_mode_management.py b/antarest/study/business/table_mode_management.py index 45472d63b5..8a83c21047 100644 --- a/antarest/study/business/table_mode_management.py +++ b/antarest/study/business/table_mode_management.py @@ -492,7 +492,7 @@ def set_table_data( enabled=col_values.get("enabled", current_binding_dto.enabled), time_step=col_values.get("type", current_binding_dto.time_step), operator=col_values.get("operator", current_binding_dto.operator), - coeffs=BindingConstraintManager.constraints_to_coeffs(current_binding_dto), + coeffs=BindingConstraintManager.terms_to_coeffs(current_binding_dto.terms), command_context=command_context, ) )