Skip to content

fix(data_processors): resolve KeyError by sorting scrap_data on tic column - #1438

Open
tarun1790 wants to merge 2 commits into
AI4Finance-Foundation:masterfrom
tarun1790:fix/yahoofinance-scrap-data-sort-tic
Open

fix(data_processors): resolve KeyError by sorting scrap_data on tic column#1438
tarun1790 wants to merge 2 commits into
AI4Finance-Foundation:masterfrom
tarun1790:fix/yahoofinance-scrap-data-sort-tic

Conversation

@tarun1790

Copy link
Copy Markdown

Fixes #1436

Summary of Changes

  • fetch_stock_data() creates a tic column for each ticker, but scrap_data() attempted to sort by ["day", "tick"], causing a KeyError: "tick".
  • Updated scrap_data() to dynamically sort by tic (or tick if present) and handle empty download frames gracefully.
  • Added unit test in unit_tests/preprocessors/test_yahoofinance_processor.py validating multi-ticker sorting and error handling.

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.

YahooFinanceProcessor.scrap_data sorts by a missing tick column

1 participant