Skip to content

Commit

Permalink
Fix missing denominator column in ALR
Browse files Browse the repository at this point in the history
Previously, if denominator column was not in selected columns, it was removed before the transformation.
  • Loading branch information
msorvoja committed Jan 7, 2025
1 parent 1bf85a9 commit 0026856
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion eis_toolkit/transformations/coda/alr.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,12 @@ def alr_transform(
if invalid_columns:
raise InvalidColumnException(f"The following columns were not found in the dataframe: {invalid_columns}.")
columns_to_transform = columns
df = df[columns_to_transform]

if denominator_column not in columns_to_transform:
df = df[columns_to_transform + [denominator_column]]
else:
df = df[columns_to_transform]

else:
columns_to_transform = df.columns.to_list()

Expand Down

0 comments on commit 0026856

Please sign in to comment.