mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-28 13:01:38 +00:00
fix failing test in sec form 13f fetcher (#7171)
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user