Skip to content

Commit

Permalink
try to fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBelthle committed Jan 22, 2025
1 parent 46ac6b4 commit 9f134ca
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion antarest/study/business/link_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def get_all_links_ts_generation_information(study_id: str) -> t.Dict[str, t.Dict
db_dictionnary: t.Dict[str, t.Dict[str, LinkTsGeneration]] = {}
with db():
all_links_parameters: t.List[LinksParametersTsGeneration] = (
db.session.query(LinksParametersTsGeneration).filter(study_id=study_id).all()
db.session.query(LinksParametersTsGeneration).filter_by(study_id=study_id).all()
)
for link_parameters in all_links_parameters:
area_from = link_parameters.area_from
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def _apply(self, study_data: FileStudy, listener: Optional[ICommandListener] = N
area_to = data["area_to"]

# Saves ini properties
to_exclude = set(Area.model_fields.keys() & LinkTsGeneration.model_fields.keys())
to_exclude = set(Area.model_fields.keys() | LinkTsGeneration.model_fields.keys())
if version < STUDY_VERSION_8_2:
to_exclude.update("filter-synthesis", "filter-year-by-year")
ini_properties = internal_link.model_dump(by_alias=True, exclude=to_exclude)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def _apply(self, study_data: FileStudy, listener: t.Optional[ICommandListener] =
internal_link = LinkInternal.model_validate(self.parameters)

# Updates ini properties
to_exclude = set(Area.model_fields.keys() & LinkTsGeneration.model_fields.keys())
to_exclude = set(Area.model_fields.keys() | LinkTsGeneration.model_fields.keys())
if version < STUDY_VERSION_8_2:
to_exclude.update("filter-synthesis", "filter-year-by-year")
new_ini_properties = internal_link.model_dump(by_alias=True, exclude=to_exclude, exclude_unset=True)
Expand Down

0 comments on commit 9f134ca

Please sign in to comment.