Enums and ms timestamp fields in Workspace Realtime API

davidk
davidk Contributor

Hi— we had been debugging the new lseg.data library realtime APIs on a system that had been running Eikon. When running eikon Eikon, fields with enums (like IMB_TYPE) and fields with timestamps (like IMB_TIM_MS and QUOTIM_MS) were all coming back as integers using the lseg.data streaming APIs, for example using the following code:

import lseg.data.content.pricing as pricing
pricing_stream = pricing.Definition(universe=['AAPL.O'], fields=['BID', 'ASK', 'QUOTIM_MS']).get_stream()
stream.get_snapshot()

# QUOTIM_MS used to be an integer, but now is a string like '20:40:42.605'

pricing_stream = pricing.Definition(universe=['AAPL.ITC'], fields=['IMB_TYPE', 'IMB_SIDE', 'IMBTIM_MS']).get_stream()
stream.get_snapshot()
# All fields used to be integers, now they are strings.

We have now cut over to Workspace for the front end, but it seems that now these fields are all coming back with text. Is this a setting that was possibly flipped when the upgrade occurred, or is this an expected change with the change of front-end? We were taken aback when the front-end update affected the API output.

Answers

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @davidk

    Thank you for reaching out to us.

    Yes, you are correct. The Workspace platform returns expanded strings for enumeration fields and converts quote times into string format. According to the log, this should happen on the workspace platform or streaming server, not in the library.

    [2025-06-17T10:16:07.105445+07:00] - [sessions.desktop.workspace.0] - [DEBUG] - [9904 - Msg-Proc-ThreadOMMSTREAMING_PRICING_0.0] - [omm_stream_connection] - [_process_message] - [OMMSTREAMING_PRICING_0.0] process message {"Fields": {"BID": 197.08, "ASK": 197.2, "QUOTIM_MS": "23:59:55.038", "CURRENCY": "USD"}, "State": {"Data": "Ok", "Stream": "NonStreaming", "Code": "None", "Text": "All is well"}, "Qos": {"Rate": "TimeConflated", "Timeliness": "DelayedUnknown"}, "Type": "Refresh", "SeqNumber": 64702, "ID": 7, "Key": {"Name": "/AAPL.O", "NameType": "Ric", "Service": "Q"}}

    I also tested it by consuming from the real-time streaming server (Real-Time Optimized). The output looks like this:

            "Fields": {
    "CURRENCY": "USD",
    "BID": 197.080000,
    "ASK": 197.200000,
    "QUOTIM_MS": 86395038
    }

    The enumeration field is expanded but the value in the QUOTIM_MS field is still an integer.

    I understand that the string value of the "QUOTIM_MS" field may be specific on the workspace.desktop session.

    We need to contact the Workspace support team to verify this behavior. I have submitted a case on your behalf. The case number is 14891197.