Skip to content

fix(backtest): handle Parquet date index name collisions - #2312

Open
marroxo wants to merge 1 commit into
HKUDS:mainfrom
marroxo:fix/local-parquet-index-collision
Open

marroxo wants to merge 1 commit into
HKUDS:mainfrom
marroxo:fix/local-parquet-index-collision

Conversation

@marroxo

@marroxo marroxo commented Nov 21, 2026

Copy link
Copy Markdown

A Parquet file can have a date index named timestamp and a regular column with the same name. When no mapped date column exists, reset_index() tries to insert a second timestamp column. The loader catches the error and drops the symbol.

Read dates directly from the index in that case. A mapped date column still takes precedence, and UTC normalization stays the same.

I reproduced the bug with a real Parquet file and added a test through DataLoader.fetch. The regression failed before the fix, and all 47 local-loader tests passed afterward with sockets disabled. The change is limited to the local loader and can be reverted independently.

Read dates from the DatetimeIndex directly when the file has no mapped date column. This keeps a same-named data column from causing reset_index to fail and the loader to drop the symbol.

Cover the collision with a Parquet round trip through DataLoader.fetch.

Signed-off-by: marroxo <129263224+marroxo@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

1 participant