devcartel / pyrfa

Open sourced Python API for Refinitiv (Thomson Reuters) Enterprise Platform.
http://devcartel.com/pyrfa
MIT License
50 stars 15 forks source link

marketPriceRequest returning integer values for RDMFieldDictionary #55

Open shashank88 opened 3 years ago

shashank88 commented 3 years ago

Hi,

We came across a strange issue when using this library. When we try to do a marketPriceRequest and in the response, we get the integer value of the RDMFieldDictionary for most fields. So instead of 'PROD_PERM', we get 1 and so on for all fields in https://raw.githubusercontent.com/devcartel/pyrfa/24ca27ec6e0cb9b1f87a9390f8d219409ccaea9f/pyrfa/RDMFieldDictionary

Sample code:


    p.marketPriceRequest(','.join(rics))
    # Wait for the snapshot to be complete
    start, elapsed = time.time(), 0
    images, completed = OrderedDict(), set()
    while completed != set(rics) and elapsed < timeout:
        logging.debug('Checking for events...')
        for msg in p.dispatchEventQueue(1000):
            if msg:
                if msg['MTYPE'] == 'IMAGE':
                    images[msg['RIC']] = OrderedDict(msg)```

in the msg, we have integers in the keys instead of the fields, and the values are Unknown DataBuffer: (1, 'Unknown DataBuffer')
This is happening for all keys apart from ['RIC', '/VXRT.O'), ('SERVICE', 'EED'), ('MTYPE', 'IMAGE')]) in the msg.

Is there something in the allocation of the string to encode the dictionary values going wrong? Anything I can do to enable some more logging to debug this better. We also have another C++ library imported to by python via pybind, can that cause issues as well?
wiwat-tharateeraparb commented 3 years ago

Looks like PyRFA cannot decode the data using dictionary provided.