Get wrong data uri when updating expression cache
🐛 Bug Description
When updating DiskExpressionCache, it raises KeyError because it tries to get data uri from the DEFAULT_FREQ while I have specified several other freqs.
To Reproduce
Call DiskExpressionCache().update() when specifying several freqs when initiating qlib server.
Expected Behavior
Correctly update the cache without error.
Environment
Note: User could run cd scripts && python collect_info.py all under project directory to get system information
and paste them here directly.
- Qlib version: 0.9.8.dev11+g348228907.d20250915
- Python version: 3.8.20 (default, Oct 3 2024, 15:24:27) [GCC 11.2.0]
- OS (
Windows,Linux,MacOS): Linux - Commit number (optional, please provide it if you are using the dev version): 213eb6c2
Additional Notes
I think just inputting freq in C.dpm.get_data_uri() at line 593 in qlib.data.cache can solve the problem.
Hi, @LeetaH666
Thank you for your attention to qlib. How can we reproduce this issue?
Hi, @LeetaH666 Thank you for your attention to
qlib. How can we reproduce this issue?
I can not provide a one-click reproducing script, but the steps are:
- dump data for several freqs, e.g., daily and 1min;
- initiate qlib-server by specifying multiple freqs in provider_uri;
- initiate a client to fetch some data with expressions in order to create DiskExpressionCache on server side;
- use script like qlib-server/scripts/update_cache.py to update DiskExpressionCache, it simply calls DiskExpressionCache().update() and raise KeyError.