diff --git a/pyproject.toml b/pyproject.toml index 2ae21fc..c786734 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ dependencies = [ "loguru", "tqdm", "streamlit", - "yfinance", + "yfinance >=0.2.54", "beautifulsoup4", "requests_cache", "requests_ratelimiter", diff --git a/stocksense/pipeline/etl.py b/stocksense/pipeline/etl.py index 29bd59c..9af6f78 100644 --- a/stocksense/pipeline/etl.py +++ b/stocksense/pipeline/etl.py @@ -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()