From 34de2f61427f2879df4ebbf5906ca0508c6e84f3 Mon Sep 17 00:00:00 2001 From: Danglewood <85772166+deeleeramone@users.noreply.github.com> Date: Wed, 16 Jul 2025 23:15:27 -0700 Subject: [PATCH] fix failing test in sec form 13f fetcher (#7171) --- openbb_platform/providers/sec/openbb_sec/utils/parse_13f.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openbb_platform/providers/sec/openbb_sec/utils/parse_13f.py b/openbb_platform/providers/sec/openbb_sec/utils/parse_13f.py index 4eb23d92da4..2d4d5352864 100644 --- a/openbb_platform/providers/sec/openbb_sec/utils/parse_13f.py +++ b/openbb_platform/providers/sec/openbb_sec/utils/parse_13f.py @@ -187,7 +187,7 @@ async def parse_13f_hr(filing: str): data.loc[:, "putCall"] = data["putCall"].fillna("--") # Add the period ending so that the filing is identified when multiple are requested. - data["period_ending"] = to_datetime(period_ending, yearfirst=False).date() + data.loc[:, "period_ending"] = to_datetime(period_ending, yearfirst=False).date() df = DataFrame(data) # Aggregate the data because there are multiple entries for each security and we need the totals. # We break it down by CUSIP, security type, and option type. @@ -220,8 +220,8 @@ async def parse_13f_hr(filing: str): if col in df.columns and all(df[col] == 0): df.drop(columns=col, inplace=True) - total_value = df["value"].sum() - df["weight"] = round(df["value"] / total_value, 6) + total_value = df.value.sum() + df.loc[:, "weight"] = round(df.value.astype(float) / total_value, 6) return ( df.reset_index()