Fix FileFeatureStorage instrument directory casing#2299
Open
Jaco-Ren wants to merge 1 commit into
Open
Conversation
Author
|
@microsoft-github-policy-service agree
|
Author
|
@microsoft-github-policy-service agree [company="{your company}"] |
Author
|
@microsoft-github-policy-service agree |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FileFeatureStoragefeature paths against existing instrument directories so vendor-preserved casing such asABB-Uis honored on case-sensitive filesystemsfeatures/ABB-U/close.day.binMotivation and Context
Fixes #2053.
FileFeatureStoragepreviously constructed feature paths withinstrument.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.pygit diff --checkFileFeatureStorageharness verifyingABB-Uresolves to the on-diskfeatures/ABB-Udirectory and reads the expected valuesI also attempted
python -m pytest tests/storage_tests/test_storage.py::TestFileFeatureStorageCaseResolution -q, but this local Windows source checkout cannot collect qlib tests untilqlib.data._libs.rollingis compiled.python setup.py build_ext --inplaceis blocked locally by missing Microsoft Visual C++ 14.0+ Build Tools.