Description
Environment
QF-Lib: 4.0.2
What happened?
If we include an invalid field in the get_history query, we will always get an empty xarray/df even though there might be data available for other valid fields. This behaviour happens when a field exception is raised, e.g.:
Response contains field exceptions: securityData = { security = "/bbgid/BBG000DNTSP4" eidData[] = { } sequenceNumber = 47 fieldExceptions[] = { fieldExceptions = { fieldId = "M6039" errorInfo = { source = "54008:rsfhdsvc1" code = 1 category = "BAD_FLD" message = "Not valid historical field" subcategory = "NOT_APPLICABLE_TO_HIST_DATA"
Reproduction steps
Example where we query a valid field with data available and an invalid field:
`
tickers = [BloombergTicker("/bbgid/BBG000BTNV54"), BloombergTicker("/bbgid/BBG000PBQ204")]
fields = ["BM383", "M6039"]
bbg_fields_xarray = price_provider.get_history(tickers,
fields,
datetime(2024, 1, 1), datetime(2024, 12, 31), Frequency.QUARTERLY,
overrides={"FILING_STATUS": "OR"})
`