-
-
Couldn't load subscription status.
- Fork 462
Open
Description
Summary
Currency conversion within portfolio collection/performance attempts to fetch NAN=X on Yahoo, leading to 404s and blank Current Value/Return/Alpha fields in recorded CSVs.
Steps to reproduce
- Run: pytest -q tests/portfolio/test_portfolio_controller.py::test_collect_historical_data
- Run: pytest -q tests/portfolio/test_portfolio_controller.py::test_get_transactions_performance
Observed behavior
- yfinance logs: HTTP Error 404: Quote not found for symbol: NAN=X
- Resulting CSVs have blank Current Value/Return/Alpha where recordings expect values.
Expected behavior
- Currency conversion is skipped or guarded when the portfolio has no explicit currency column, and no NAN=X symbol is constructed.
Context
- The tests set portfolio._currency_column = None to avoid currency conversion.
- Currency conversion logic constructs pairs from historical statistics currency vs transaction currency; when a currency is missing/NaN this results in NAN=X and a 404.
Environment
- Branch: main (upstream)
- Tests use recorded datasets in tests/datasets without external credentials
Potential approaches (for maintainers’ consideration)
- Add guards to skip conversion when currency codes are missing/NaN or when _currency_column is falsy
- Validate derived currency pair strings before requesting market data
Additional information
- This was encountered while running the full suite; unrelated to feature work. Reporting for visibility and guidance on intended behavior when currency codes are absent.
Metadata
Metadata
Assignees
Labels
No labels