Getting KeyError: 'symbol' while calling get_instrument_by_symbol()

Traceback (most recent call last):
File “/home/ubuntu/.local/lib/python3.10/site-packages/pandas/core/indexes/base.py”, line 3803, in get_loc
return self._engine.get_loc(casted_key)
File “pandas/_libs/index.pyx”, line 138, in pandas._libs.index.IndexEngine.get_loc
File “pandas/_libs/index.pyx”, line 165, in pandas._libs.index.IndexEngine.get_loc
File “pandas/_libs/hashtable_class_helper.pxi”, line 5745, in pandas._libs.hashtable.PyObjectHashTable.get_item
File “pandas/_libs/hashtable_class_helper.pxi”, line 5753, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: ‘symbol’

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “/home/ubuntu/ab/ab_options.py”, line 1540, in
ins_nifty = alice.get_instrument_by_symbol(‘INDICES’, ‘NIFTY 50’)
File “/home/ubuntu/.local/lib/python3.10/site-packages/pya3/alicebluepy.py”, line 542, in get_instrument_by_symbol
filter_contract = contract[contract[‘symbol’] == symbol.upper()]
File “/home/ubuntu/.local/lib/python3.10/site-packages/pandas/core/frame.py”, line 3804, in getitem
indexer = self.columns.get_loc(key)
File “/home/ubuntu/.local/lib/python3.10/site-packages/pandas/core/indexes/base.py”, line 3805, in get_loc
raise KeyError(key) from err
KeyError: ‘symbol’

Kindly try to redownload the contract master

I download the master contract every day at 9:01 AM but still got this error. Why did this error occur for me?

every day the contract master needs to be downloaded after 8 am Before 08:00 AM the previous day’s contract file is downloaded which is a known condition, as it is done technically, due to any glitch or any network issue .etc, the contract master wouldn’t be downloaded properly, as you set time to download the contract master try to make sure the file is downloaded as expected or not, if not then try to download manually once again.

How will we know that master contract data is downloaded correctly or not? And what was the glitch today?

Any update Aliceteam

@nandagopal Please update here.

The sign when the contract master is not downloaded properly, if the get_instrument_by_symbol or token gives error message like not found the exchange or the symbol.