Skip to content

Fix FileFeatureStorage instrument directory casing#2299

Open
Jaco-Ren wants to merge 1 commit into
microsoft:mainfrom
Jaco-Ren:fix-file-feature-storage-case
Open

Fix FileFeatureStorage instrument directory casing#2299
Jaco-Ren wants to merge 1 commit into
microsoft:mainfrom
Jaco-Ren:fix-file-feature-storage-case

Conversation

@Jaco-Ren

Copy link
Copy Markdown

Summary

  • resolve FileFeatureStorage feature paths against existing instrument directories so vendor-preserved casing such as ABB-U is honored on case-sensitive filesystems
  • keep the historical lowercase path as the fallback when no matching directory exists
  • add a regression test that reads a feature file from features/ABB-U/close.day.bin

Motivation and Context

Fixes #2053.

FileFeatureStorage previously constructed feature paths with instrument.lower(), which works for qlib's lowercase datasets but fails on case-sensitive filesystems when local/vendor data is stored with uppercase or mixed-case instrument directories. In that case every feature request resolves to the lowercased path and returns empty data even though the requested instrument's files exist.

Testing

  • python -m py_compile qlib\data\storage\file_storage.py tests\storage_tests\test_storage.py
  • git diff --check
  • isolated FileFeatureStorage harness verifying ABB-U resolves to the on-disk features/ABB-U directory and reads the expected values

I also attempted python -m pytest tests/storage_tests/test_storage.py::TestFileFeatureStorageCaseResolution -q, but this local Windows source checkout cannot collect qlib tests until qlib.data._libs.rolling is compiled. python setup.py build_ext --inplace is blocked locally by missing Microsoft Visual C++ 14.0+ Build Tools.

@Jaco-Ren

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@Jaco-Ren please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@Jaco-Ren Jaco-Ren closed this Jul 10, 2026
@Jaco-Ren

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree [company="{your company}"]

@Jaco-Ren Jaco-Ren reopened this Jul 10, 2026
@Jaco-Ren

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@Jaco-Ren Jaco-Ren marked this pull request as ready for review July 10, 2026 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FileFeatureStorage lowercases the instrument directory name when building feature paths

1 participant