qlib icon indicating copy to clipboard operation
qlib copied to clipboard

Get wrong data uri when updating expression cache

Open LeetaH666 opened this issue 3 months ago • 2 comments

🐛 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.

LeetaH666 avatar Sep 15 '25 08:09 LeetaH666

Hi, @LeetaH666 Thank you for your attention to qlib. How can we reproduce this issue?

SunsetWolf avatar Sep 16 '25 06:09 SunsetWolf

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:

  1. dump data for several freqs, e.g., daily and 1min;
  2. initiate qlib-server by specifying multiple freqs in provider_uri;
  3. initiate a client to fetch some data with expressions in order to create DiskExpressionCache on server side;
  4. use script like qlib-server/scripts/update_cache.py to update DiskExpressionCache, it simply calls DiskExpressionCache().update() and raise KeyError.

LeetaH666 avatar Sep 16 '25 06:09 LeetaH666