From f9af638b926ddfab760ac76c9ea7b06b48297c53 Mon Sep 17 00:00:00 2001 From: Mohamed Abdel Wedoud Date: Thu, 28 Nov 2024 17:24:30 +0100 Subject: [PATCH] feat(aggregation-apis): update following code review --- antarest/study/business/aggregator_management.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/antarest/study/business/aggregator_management.py b/antarest/study/business/aggregator_management.py index b988a3d67c..da2bdf846f 100644 --- a/antarest/study/business/aggregator_management.py +++ b/antarest/study/business/aggregator_management.py @@ -326,7 +326,7 @@ def _process_df(self, file_path: Path, is_details: bool) -> pd.DataFrame: renamed_cols = [] # check if there is a production column to rename it to `PRODUCTION_COLUMN_NAME` prod_col = _infer_column_from_regex(actual_cols, PRODUCTION_COLUMN_REGEX) - if prod_col is not None: + if prod_col: prod_col_name = ( PRODUCTION_COLUMN_NAME_ST if ( @@ -338,10 +338,9 @@ def _process_df(self, file_path: Path, is_details: bool) -> pd.DataFrame: new_obj[prod_col_name] = new_obj.pop(prod_col) actual_cols.remove(prod_col) renamed_cols.append(prod_col_name) - for col_regex, new_col_name in RENAME_MAPPING.items(): col_name = _infer_column_from_regex(actual_cols, col_regex) - if col_name is not None: + if col_name: new_obj[new_col_name] = new_obj.pop(col_name) actual_cols.remove(col_name) renamed_cols.append(new_col_name)