Skip to content

Commit

Permalink
fix test..?
Browse files Browse the repository at this point in the history
  • Loading branch information
deeleeramone committed Nov 22, 2024
1 parent ec3955c commit 4dec2cf
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,15 @@ def extract_data(

terms = [term.strip() for term in query.query.split(";")] if query.query else []

df = DataFrame(all_symbols).T.reset_index().rename(columns={"index": "symbol"})
df = (
DataFrame(all_symbols)
.T.reset_index()
.rename(columns={"index": "symbol"})
.replace({nan: None})
)

if not terms:
records = df.to_dict(orient="records").replace({nan: None})
records = df.to_dict(orient="records")
else:
combined_mask = Series([True] * len(df))
for term in terms:
Expand All @@ -107,7 +112,7 @@ def extract_data(
if matches.empty:
raise EmptyDataError("No results found for the provided query.")

records = matches.replace({nan: None}).to_dict(orient="records")
records = matches.to_dict(orient="records")

return records

Expand Down

0 comments on commit 4dec2cf

Please sign in to comment.