Skip to content

fix: reuse filtered instruments across field groups#2243

Open
he-yufeng wants to merge 1 commit into
microsoft:mainfrom
he-yufeng:fix/filter-pipe-once
Open

fix: reuse filtered instruments across field groups#2243
he-yufeng wants to merge 1 commit into
microsoft:mainfrom
he-yufeng:fix/filter-pipe-once

Conversation

@he-yufeng
Copy link
Copy Markdown

Fixes #2236.

QlibDataLoader resolves filter_pipe inside load_group_df(). With grouped field configs, load() calls load_group_df() once per fields group, so the same market string runs through D.instruments(..., filter_pipe=...) repeatedly.

This resolves string instruments once at the grouped-loader entry point and reuses that instrument config for each group. Direct load_group_df() calls keep the old behavior, and explicit non-string instrument lists still warn that filter_pipe is ignored.

To verify

  • python -m pytest tests\data_mid_layer_tests\test_dataloader.py -q -k grouped_loader
  • python -m py_compile qlib\data\dataset\loader.py tests\data_mid_layer_tests\test_dataloader.py
  • git diff --check

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.

[SeriesDFilter] Redundant execution of filter_pipe for each fields_group causes slow data loading

1 participant