Skip to content

Commit c54ef91

Browse files
committed
fix grouping issue on secondary summary generation (#2370)
1 parent abb7b48 commit c54ef91

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

per/ops_learning_summary.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,6 @@ def _contextualize_learnings(df):
486486
df.at[index, "learning"] = (
487487
f"{row['excerpts_id']}. In {row['appeal_year']} in {row['appeal_name']}: {row['learning']}"
488488
)
489-
490-
df = df.drop(columns=["appeal_name"])
491489
logger.info("Contextualization added to DataFrame.")
492490
return df
493491

@@ -561,7 +559,7 @@ def seconday_prioritize_excerpts(cls, df: pd.DataFrame):
561559
secondary_learning_df = df.drop_duplicates(subset=["learning", "component", "sector"]).sort_values(
562560
by=["appeal_name", "component", "appeal_year"], ascending=[True, True, False]
563561
)
564-
grouped = secondary_learning_df.groupby("component", "appeal_name")
562+
grouped = secondary_learning_df.groupby(["component", "appeal_name"])
565563

566564
# Create an interleaved list of rows
567565
interleaved = list(chain(*zip_longest(*[group[1].itertuples(index=False) for group in grouped], fillvalue=None)))

0 commit comments

Comments
 (0)