Skip to content

FileFeatureStorage lowercases the instrument directory name when building feature paths #2053

@maxilirator

Description

@maxilirator

FileFeatureStorage lowercases the instrument directory name when building feature paths (instrument.lower()/field.lower().freq.bin). On case‑sensitive filesystems (e.g., Linux) where the vendor data is stored with uppercase instrument folders (data/xsto/features/ABB-U/...), the loader looks for abb-u/…, can’t find the file, and every expression resolves to an empty dataframe even though the data exists.

To Reproduce

Steps to reproduce the behavior:

Store local feature data under uppercase instrument directories (e.g., data/xsto/features/ABB-U/close.day.bin).
Initialize qlib with that provider URI.
Request any feature for that instrument, e.g. D.features(["ABB-U"], ["$close"], "2000-01-01", "2025-12-31"). The result is an empty dataframe and the feature storage backend reports the file is missing.

Expected Behavior

FileFeatureStorage should respect the actual on-disk casing instrument list (or probe common case variants) so that features load correctly regardless of filesystem case sensitivity.

Screenshot

N/A – the console logs show statements such as [FileFeatureStorage.getitem] uri=…/features/abb-u/close.day.bin missing for request=… even though …/features/ABB-U/close.day.bin exists.

Environment

Version: 0.9.7
Python version: 3.12 (virtual env)
OS: Linux (Ubuntu on AMD cloud server, case-sensitive filesystem)
Commit number: N/A (using pip wheel)
Additional Notes
We patched FileFeatureStorage locally to keep multiple filename candidates (instrument.lower(), original case, uppercase) and select the first existing path before reading. After this change ABB-U and other uppercase symbols load correctly. Happy to submit a PR if this approach sounds acceptable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions