Skip to content
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

[BugFix] Allow lowercase symbol for EconDB EconomicIndicators #6642

Merged
merged 2 commits into from
Aug 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ async def aextract_data( # pylint: disable=R0914.R0912,R0915
new_symbols: List = []
# We need to join country, symbol, and transformation
# for every combination of country and symbol.
for symbol in symbols:
for s in symbols:
# We will assume that if the symbol has a '~' in it,
# the user knows what they are doing. We don't want to
# match this defined symbol with any supplied country, and we need to
Expand All @@ -210,9 +210,10 @@ async def aextract_data( # pylint: disable=R0914.R0912,R0915
# and return the symbol as 'level' if it is not.
# We will also check if the symbol should have a country,
# and if one was supplied.
symbol = s.upper()
if "~" in symbol:
_symbol = symbol.split("~")[0].upper()
_transform = symbol.split("~")[1].upper()
_symbol = symbol.split("~")[0]
_transform = symbol.split("~")[1]
if (
helpers.HAS_COUNTRIES.get(_symbol) is True
and _symbol in helpers.SYMBOL_TO_INDICATOR.values()
Expand Down Expand Up @@ -275,7 +276,9 @@ async def aextract_data( # pylint: disable=R0914.R0912,R0915
):
new_symbols.append(symbol)
if not new_symbols:
symbol_message = helpers.INDICATOR_COUNTRIES.get(query.symbol, "None")
symbol_message = helpers.INDICATOR_COUNTRIES.get(
query.symbol.upper(), "None"
)
error_message = (
"No valid combination of indicator symbols and countries were supplied."
+ f"\nValid countries for '{query.symbol}' are: {symbol_message}"
Expand Down
Loading