Refactor the service layer#79
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 17cfee10c4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| source = DataSource(name="", provider_kind="") | ||
| instrument = Instrument(symbol="EUR/USD", name="EUR - USD", asset_class="fx") |
There was a problem hiding this comment.
Populate the trend request with usable FX metadata
When the Trend Chart is opened on a fresh database, this request is the only thing used by prepare_trend_analysis. read_price_bars searches by source.name and instrument.symbol, so name="" won't match rows inserted under real sources, and on a miss yfinance_client.get_timeseries constructs its ticker from instrument.base_currency and quote_currency, both left as None here. The result is a NoneNone=X lookup and no chart for EUR/USD instead of fetching/caching the intended pair.
Useful? React with 👍 / 👎.
| if 0 == 0: | ||
| return None |
There was a problem hiding this comment.
Restore the API lookup for legacy conversions
After interface.py was switched to import legacy.services.conversion_service, every legacy CLI conversion reaches this get_conv_rate. This unconditional branch returns None for all currency pairs, so display_convert never succeeds and stays in the retry loop even for valid inputs that used to call exchangerate_client.get_rates. Please keep the real rate lookup when moving the service.
Useful? React with 👍 / 👎.
What changed?
Related issue
Closes #71
Tests
pytestChecklist
Notes