-
Notifications
You must be signed in to change notification settings - Fork 3
Refactor the service layer #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
132877b
3fce8c7
f1441a4
701a7a9
17cfee1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| from argus.clients import exchangerate_client as ex_client | ||
| from argus.domain.validation import normalize_input_string, is_valid_curr_code | ||
|
|
||
|
|
||
|
|
@@ -18,7 +17,7 @@ def check_currency(question: str) -> str | None: | |
| return None | ||
|
|
||
|
|
||
| def get_conv_rate(resp1: str, resp2: str) -> float | None: | ||
| def get_conv_rate(resp1, resp2) -> float | None: | ||
| """ | ||
| Gets the conversion rate between two currencies. | ||
|
|
||
|
|
@@ -28,12 +27,12 @@ def get_conv_rate(resp1: str, resp2: str) -> float | None: | |
| Return: float or None - the conversion rate if found, otherwise None | ||
| """ | ||
|
|
||
| data = ex_client.get_rates(resp1, resp2) | ||
| # data = ex_client.get_rates(req) | ||
|
|
||
| if data is None: | ||
| if 0 == 0: | ||
| return None | ||
|
Comment on lines
+32
to
33
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
After Useful? React with 👍 / 👎. |
||
|
|
||
| return float(data["conversion_rate"]) | ||
| return None # float(data["conversion_rate"]) | ||
|
|
||
|
|
||
| def convert(amount: float, resp1: str, resp2: str) -> float | None: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the Trend Chart is opened on a fresh database, this request is the only thing used by
prepare_trend_analysis.read_price_barssearches bysource.nameandinstrument.symbol, soname=""won't match rows inserted under real sources, and on a missyfinance_client.get_timeseriesconstructs its ticker frominstrument.base_currencyandquote_currency, both left asNonehere. The result is aNoneNone=Xlookup and no chart for EUR/USD instead of fetching/caching the intended pair.Useful? React with 👍 / 👎.