matthewgilbert / pdblp

pandas wrapper for Bloomberg Open API
MIT License
241 stars 68 forks source link

returns bulk reference data which is not supported #57

Closed gflores87 closed 5 years ago

gflores87 commented 5 years ago

Code Sample, a copy-pastable example if possible

output = dict()
con = pdblp.BCon(debug=False, port=8194, timeout=gbl_to)
con.start()
expiry_us = con.ref('SPX Index', 'CHAIN_TICKERS', ovrds=[('CHAIN_EXP_DT_OVRD', '1f-9f')])

Problem description

I've used this code before without a problem. However I recently had to uninstall and reinstall my entire Python setup and now when I run my code I get :

Traceback (most recent call last):

File "", line 1, in runfile('C:/Users/GFloresGonzalez/Documents/Projects/Cap Arb/capArb-runner.py', wdir='C:/Users/GFloresGonzalez/Documents/Projects/Cap Arb')

File "C:\Users\GFloresGonzalez\AppData\Local\Continuum\anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 704, in runfile execfile(filename, namespace)

File "C:\Users\GFloresGonzalez\AppData\Local\Continuum\anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 108, in execfile exec(compile(f.read(), filename, 'exec'), namespace)

File "C:/Users/GFloresGonzalez/Documents/Projects/Cap Arb/capArb-runner.py", line 21, in main()

File "C:\Users\GFloresGonzalez\Documents\Projects\Cap Arb\capArb\option_Generator.py", line 25, in main option_prices['EU'], mkt_eu = run_option_pricer('EU', tickers['EU'])

File "C:\Users\GFloresGonzalez\Documents\Projects\Cap Arb\capArb\SocGen.py", line 781, in run_option_pricer mkt_data = get_market_data()

File "C:\Users\GFloresGonzalez\Documents\Projects\Cap Arb\capArb\SocGen.py", line 232, in get_market_data expiry_us = con.ref('SPX Index', 'CHAIN_TICKERS', ovrds=[('CHAIN_EXP_DT_OVRD', '1f-9f')])

File "C:\Users\GFloresGonzalez\AppData\Local\Continuum\anaconda3\lib\site-packages\pdblp\pdblp.py", line 364, in ref data = self._parse_ref(flds)

File "C:\Users\GFloresGonzalez\AppData\Local\Continuum\anaconda3\lib\site-packages\pdblp\pdblp.py", line 391, in _parse_ref .format(fld))

ValueError: Field 'CHAIN_TICKERS' returns bulk reference data which is not supported

Version Information

Version: 0.1.8

matthewgilbert commented 5 years ago

Use bulkref instead of ref for bulk reference data. There were issues with using ref for bulk data, see the relevant discussion here https://github.com/matthewgilbert/pdblp/issues/35

gflores87 commented 5 years ago

Got it. Is this related to 3.7 vs 3.6?

matthewgilbert commented 5 years ago

No this is related to an oversight / bug in how the assumptions ref was making for dealing with ReferenceDataResponses. There is also more discussion on the issue at https://github.com/matthewgilbert/pdblp/issues/5

gflores87 commented 5 years ago

Then that's really odd because yesterday my that exact code was running normally and today it's crashing. I just wanted to comment since I believe is valuable feedback for you. Also, once again, thank you for sharing this wrapper with us, it's great :)