Skip to content

[Bug]: BBG provider: empty container returned if bad field included #221

Open
@marekbais

Description

@marekbais

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"})
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions