fix: resolve pandas 3.0 StringDtype compatibility issue

Return pd.Series with object dtype instead of modifying Series in-place
to avoid "setting an array element with a sequence" error when running
with pandas 3.0.0 in CI.
This commit is contained in:
Junya Morioka
2026-01-25 16:43:50 +09:00
parent 8d44668ec1
commit f9e440af2c
+3 -7
View File
@@ -303,13 +303,9 @@ def merge_duplicate_rows(df: pd.DataFrame) -> pd.DataFrame:
seen.add(pkg)
unique_packages.append(pkg)
# Take the first row as base
result = group.iloc[0].copy()
# Combine packages into a list
result["package"] = unique_packages if unique_packages else [None]
return result
# Return as a Series with object dtype to avoid pandas 3.0 StringDtype issues
packages = unique_packages if unique_packages else [None]
return pd.Series({"package": packages}, dtype=object)
# Group and combine
merged_df = df.groupby(group_cols, as_index=False).apply(