Skip to content

Conversation

@anish-devgit
Copy link

Summary

Fixes #2053: FileFeatureStorage incorrectly lowercases instrument directory names, causing failures on case-sensitive file systems.

What I changed

  • Updated qlib/data/storage/file_storage.py to resolve instrument directories using the correct filesystem case when available.
  • Added a fallback to lowercase paths for backward compatibility.
  • Ensured new file creation preserves the original instrument case.
  • Added tests/storage_tests/test_issue_2053.py to validate behavior on case-sensitive systems.

How I tested

  • Added an isolated test (test_issue_2053.py) that reproduces the issue by creating an uppercase instrument directory.
  • Verified that FileFeatureStorage resolves paths correctly after the fix.
  • Note: Full test suite was not executed locally due to heavy optional dependencies; CI should validate integration.

Before / After

Before
FileFeatureStorage(instrument="AAPL").uri.../aapl/close.day.bin (fails if directory is AAPL)

After
FileFeatureStorage(instrument="AAPL").uri.../AAPL/close.day.bin

Fixes #2053

…age (microsoft#2053)

- Changed FileFeatureStorage.file_name to a property that checks for existing file paths.
- Preserves case sensitivity for new files and existing uppercase directories.
- Maintains backward compatibility for lowercase paths.
- Added verification test case.
@anish-devgit
Copy link
Author

@microsoft-github-policy-service agree

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