To replicate, please query BDS("FNR 2021-2 AI Mtge", "HIST_LOSSES"). This is an agency CMO so that naturally should not return a real value, but I believe this should probably return None instead of failing.
def collect_to_bds(self, responses: Iterable) -> pandas.DataFrame:
"""Collector for bds()."""
rows = []
field = None
for response in responses:
keys = list(response["data"].keys())
if len(keys) > 1:
raise ValueError(f"responses must have only one field, received {keys}")
if field is not None and field != keys[0]:
raise ValueError(f"responses contain different fields, {field} and {keys[0]}")
> field = keys[0]
E IndexError: list index out of range
envs\dd37b9a02dc1d7344d536c893525a5836cbe391f\lib\site-packages\blp\blp.py:868: IndexError
This is what response looks like (note I used the Bloomberg unique ID to query):
To replicate, please query
BDS("FNR 2021-2 AI Mtge", "HIST_LOSSES")
. This is an agency CMO so that naturally should not return a real value, but I believe this should probably returnNone
instead of failing.This is what
response
looks like (note I used the Bloomberg unique ID to query):{'security': 'MG!!02QEYQ Mtge', 'fields': ['HIST_LOSSES'], 'data': {}}