Rblp / Rblpapi

R package interfacing the Bloomberg API from https://www.bloomberglabs.com/api/
Other
167 stars 75 forks source link

Examples in bsrch don't work #356

Closed johnlaing closed 2 years ago

johnlaing commented 2 years ago

As noted by @mtkerbeR in #355

library(Rblpapi)
blpConnect()
bsrch("COMDTY:NGFLOW", verbose=TRUE)
#> Sending Request: ExcelGetGridRequest = { Domain = "COMDTY:NGFLOW" }
#> Processing Response
#> GridResponse = {
#>     NumOfFields = 0
#>     NumOfRecords = 0
#>     ColumnTitles[] = {
#>     }
#>     DataRecords[] = {
#>     }
#>     ReachMax = false
#>     Error = "The domain entered: COMDTY:NGFLOW is not valid."
#>     SequenceNumber = 0
#> }
#> 0 records returned
#> Returned columns:
#> ColumnTitles[] = {
#> }
#> Columns converted to C++ vector
#> 0 Rows expected
#> Dataframe mit 0 Spalten und 0 Zeilen

And with further digging also from Michael: After some research on this, it seems that there are two main domains used for function bsrch:

  1. COMDTY: All examples I found in this category (i.e. bsrch("COMDTY:Weather") and bsrch("COMDTY:SHIP")) need additional parameters. According to Bloomberg Excel Example Sheet: "BSRCH allows you to download vessel data dynamically. Searches can be constructed by selecting parameters for the INPUT and OUTPUT preceded by COMDTY:SHIP". But additional parameters are currently not implemented for function Rblpapi::bsrch.

  2. FI: According to Bloomberg Excel Help: "You can use BSRCH to import the results of a saved search from the Fixed Income Search (SRCH) function, so you can analyze the list of bonds or loans in Excel."

Hence a solution could be to have:

johnlaing commented 2 years ago

We should certainly add a note about how to construct an FI search, perhaps with a reference to the relevant Bloomberg doc. Maybe we can change the example to something fake like "FI:YOURSRCH" and wrap it in donttest. To me this is preferable to no examples and examples-relying-on-user-defined-options.

We should also note that COMDTY searches don't work due to missing parameters. If someone would like to step up and add that feature we'd be receptive to the PR. I don't use it so likely won't be doing that work myself.

eddelbuettel commented 2 years ago

As you now split the discussion between #355 and #356 here, feel free to also get back to me as to whether you consider this a release blocker or not. AFAICR bsrch always was an add-on (by @wmorgan85) that was possibly less used so ... I'd be happy to just remove/comment-out the example and tests. I don't see this as a critical feature. Other takers?

johnlaing commented 2 years ago

As I see it, the most likely outcome is that we update the docs. That's low-hanging fruit and can easily be done prior to a new release. If anyone feels differently about what we ought to do about broken bsrch that might change whether we hold a release for it.

eddelbuettel commented 2 years ago

Do you want to just push an update? (About to brace the cold here and go running....)