Skip to content

Commit

Permalink
Merge branch 'master' of github.com:quarkfin/qf-lib into update-arch
Browse files Browse the repository at this point in the history
  • Loading branch information
eirik-thorp committed Jul 11, 2024
2 parents c520751 + fad235f commit 5211a7d
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,10 @@ def _ticker_into_openfigi_requests(self, ticker: BloombergTicker) -> Dict[str, s
try:
parameters, match_params = sec_type_to_parameters[ticker.security_type]
# Remove the /ticker/ part if applicable
request = dict(zip(parameters, re.match(match_params, ticker.as_string().lstrip("/ticker/")).groups()))
ticker_str = ticker.as_string().replace("/ticker/", "")
ticker_str = re.sub("^" + re.escape("USD"), '', ticker_str) \
if ticker.security_type is SecurityType.FX else ticker_str
request = dict(zip(parameters, re.match(match_params, ticker_str).groups()))
return {"idType": "TICKER", **request}
except KeyError:
raise ValueError(f"The {ticker.security_type} is not supported by the {self.__class__.__name__}.") from None
Expand Down

0 comments on commit 5211a7d

Please sign in to comment.