Skip to content

Commit

Permalink
Fix bug in sp500 change detection.
Browse files Browse the repository at this point in the history
  • Loading branch information
Francisco Silva committed Feb 20, 2025
1 parent 1c705bc commit 4b6c821
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies = [
"loguru",
"tqdm",
"streamlit",
"yfinance",
"yfinance >=0.2.54",
"beautifulsoup4",
"requests_cache",
"requests_ratelimiter",
Expand Down
7 changes: 3 additions & 4 deletions stocksense/pipeline/etl.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,9 @@ def _delist_stocks(
for tic in last_constituents:
if tic not in current_constituents:
if tic in removals_list:
removed_date = dt.datetime.strptime(
removals.filter(pl.col("name_removed") == tic)["removed"].to_list()[0],
"%Y-%m-%d",
).date()
removed_date = removals.filter(pl.col("tic") == tic)["removed"].to_list()[0]
if isinstance(removed_date, str):
removed_date = dt.datetime.strptime(removed_date, "%Y-%m-%d").date()
self.db.update_stock(tic, {"date_removed": removed_date})
else:
today = dt.datetime.now().date()
Expand Down

0 comments on commit 4b6c821

Please sign in to comment.