So up until yesterday, this function was working fine. Do we know if bbg has changed something? The data frame is coming back as empty
Empty DataFrame
Columns: []
Index: []
function code below
from xbbg import blp
def get_bbg_tickers(index_import):
"""Take the index name and query data from Bloomberg,
Return a list of tickers instead."""
index_members = blp.bds(index_import, flds='')
print(index_members)
Traceback (most recent call last):
File "C:\ProgramData\Miniconda3\lib\site-packages\pandas\core\indexes\base.py", line 3621, in get_loc
return self._engine.get_loc(casted_key)
File "pandas_libs\index.pyx", line 136, in pandas._libs.index.IndexEngine.get_loc
File "pandas_libs\index.pyx", line 163, in pandas._libs.index.IndexEngine.get_loc
File "pandas_libs\hashtable_class_helper.pxi", line 5198, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas_libs\hashtable_class_helper.pxi", line 5206, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'member_ticker_and_exchange_code'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\cygwin64\home\Administrator\a\main.py", line 17, in
get_bbg_tickers('TSLA US Equity')
File "C:\cygwin64\home\Administrator\a\main.py", line 12, in get_bbg_tickers
index_members["member_ticker_and_exchange_code"] = index_members["member_ticker_and_exchange_code"]
File "C:\ProgramData\Miniconda3\lib\site-packages\pandas\core\frame.py", line 3505, in getitem
indexer = self.columns.get_loc(key)
File "C:\ProgramData\Miniconda3\lib\site-packages\pandas\core\indexes\base.py", line 3623, in get_loc
raise KeyError(key) from err
KeyError: 'member_ticker_and_exchange_code'
Hi,
So up until yesterday, this function was working fine. Do we know if bbg has changed something? The data frame is coming back as empty
Empty DataFrame Columns: [] Index: []
function code below
The error message is below
Traceback (most recent call last): File "C:\ProgramData\Miniconda3\lib\site-packages\pandas\core\indexes\base.py", line 3621, in get_loc return self._engine.get_loc(casted_key) File "pandas_libs\index.pyx", line 136, in pandas._libs.index.IndexEngine.get_loc File "pandas_libs\index.pyx", line 163, in pandas._libs.index.IndexEngine.get_loc File "pandas_libs\hashtable_class_helper.pxi", line 5198, in pandas._libs.hashtable.PyObjectHashTable.get_item File "pandas_libs\hashtable_class_helper.pxi", line 5206, in pandas._libs.hashtable.PyObjectHashTable.get_item KeyError: 'member_ticker_and_exchange_code'
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "C:\cygwin64\home\Administrator\a\main.py", line 17, in
get_bbg_tickers('TSLA US Equity')
File "C:\cygwin64\home\Administrator\a\main.py", line 12, in get_bbg_tickers
index_members["member_ticker_and_exchange_code"] = index_members["member_ticker_and_exchange_code"]
File "C:\ProgramData\Miniconda3\lib\site-packages\pandas\core\frame.py", line 3505, in getitem
indexer = self.columns.get_loc(key)
File "C:\ProgramData\Miniconda3\lib\site-packages\pandas\core\indexes\base.py", line 3623, in get_loc
raise KeyError(key) from err
KeyError: 'member_ticker_and_exchange_code'