Workspace API Error-please help to check and provide solution steps

User ID: bominxxx

Permission: Workspace hosted internet.

User used below scripts to test code:

import lseg.data as ld

import pandas as pd

sss = ld.open_session()

fields = ['TR.IndicatorName','TR.IndicatorType','TR.IndicatorSource'

          ,'ECI_ACT_DT' # GMT Date

          ,'ACT_VAL_NS' # Time

          ,'FCAST_PRD' # Period

          ,'ECON_ACT' # Actual

          ,'RTR_POLL' # Reuters Poll

          ,'ECON_PRIOR' # Prior

          ,'ECON_REV' # Revised

         ]

df = ld.get_data(

    universe='USNFAR=ECI',

    fields=fields

)

df

```

 

Then, user saw the error in below details.

Error messages:
```
C:\Users\risksoft\PycharmProjects\pythonProject1\.venv\Scripts\python.exe C:\Users\risksoft\PycharmProjects\pythonProject1\test.py
An error occurred while requesting URL('http://localhost:9000/api/udf').
ReadTimeout('timed out')
Traceback (most recent call last):
  File "C:\Users\risksoft\PycharmProjects\pythonProject1\test.py", line 26, in <module>
    df = ld.get_data(
         ^^^^^^^^^^^^
  File "C:\Users\risksoft\PycharmProjects\pythonProject1\.venv\Lib\site-packages\lseg\data\_access_layer\get_data_func.py", line 87, in get_data
    return _get_data_eikon_approach(universe, fields, parameters, header_type, session)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\risksoft\PycharmProjects\pythonProject1\.venv\Lib\site-packages\lseg\data\_access_layer\get_data_func.py", line 138, in _get_data_eikon_approach
    raise_if_all(exceptions)
  File "C:\Users\risksoft\PycharmProjects\pythonProject1\.venv\Lib\site-packages\lseg\data\_access_layer\get_data_func.py", line 94, in raise_if_all
    raise LDError(message="\n\n".join(exceptions))
lseg.data._errors.LDError: timed out
```

Please help take a look.

Thank you

Adrien

Answers

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @hongsen

    Thank you for reaching out to us.

    The client can increase the timeout value and enable the debug log by using the following code before opening a session.

    config = ld.get_config()
    config.set_param("logs.transports.console.enabled", True)
    config.set_param("logs.level", "debug")
    config.set_param("logs.transports.file.name", "lseg-data-lib.log")
    config.set_param("http.request-timeout", 6000)
    
    ld.open_session()

    Then, please share the lseg-data-lib.log file when the problem occurred.