Skip to content

Commit

Permalink
feat(aggregation-apis): update following code review
Browse files Browse the repository at this point in the history
  • Loading branch information
mabw-rte committed Dec 3, 2024
1 parent 133a445 commit f9af638
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions antarest/study/business/aggregator_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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)
Expand Down

0 comments on commit f9af638

Please sign in to comment.