-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/tz cache lazy load #1709
Conversation
The initial singleton design pattern for database access meant that lazy-loading was broken, due to structure of '_KV' class. So errors were blocking import. Fix = use 'peewee' proxy database and initialise when needed.
Lazy loading is working correctly but execution will fail on read-only file systems. Were you expecting this? |
No didn't expect that. Should be fixed now plus added some unit tests. |
There are still some issues with this import yfinance as yf
# this works
ticker = yf.Ticker("MSFT")
# This returns an empty dataframe when the code is executed in Read only fs
df = yf.download("MSFT")
print(ticker.info)
print(df.tail()) output
|
I can't reproduce with little effort, so can you re-run after |
Reproduce locally
FROM python:3.11
COPY . .
RUN pip install -r requirements.txt
CMD ["python", "your_test_script.py"]
Build the container docker build -t yfinance-test . Run the container in a read-only env docker run --read-only yfinance-test |
Line numbers don't match code. Did you |
Nope, you were right, I wasn't up to date. Everything works perfectly. Can you make a beta release? |
The initial singleton design pattern for database access meant that lazy-loading was broken,
due to structure of '_KV' class. So errors were blocking import.
Fix = use 'peewee' proxy database and initialise when needed.