Skip to content

Commit

Permalink
Fix exchanges bug
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanAkkerman committed Apr 2, 2024
1 parent cb6b889 commit a20df74
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/util/tweet_embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,17 +211,16 @@ async def add_financials(
if base_symbol in base_symbols:
continue

# Db cannot save lists
if exchanges == []:
exchanges = None

# Convert info to a dataframe
df = pd.DataFrame(
[
{
"ticker": ticker,
"website": website,
"exchanges": ";".join(exchanges),
# Db cannot handle lists, so we convert them to strings
"exchanges": (
";".join(exchanges) if len(exchanges) > 0 else ""
),
"base_symbol": base_symbol,
"timestamp": datetime.datetime.now(),
}
Expand All @@ -248,6 +247,7 @@ async def add_financials(
]
website = ticker_info["website"].values[0]
exchanges = ticker_info["exchanges"].values[0]
# Convert string to list
exchanges = exchanges.split(";")
base_symbol = ticker_info["base_symbol"].values[0]

Expand Down

0 comments on commit a20df74

Please sign in to comment.