how to "catch" statusCode == 'Error' with normalization = false flag

dataFrame = ek.get_timeseries(rics=["INDQ19","IPCZ9","INDQ20"], start_date="2018-12-21 00:00:00", end_date="2018-12-21 00:00:01", interval="daily", normalize=False, raw_output=1)

I'm getting the response for INDQ19 and INDQ20.

But there is nothing for "IPCZ9" . Only print to the std output "Error with IPCZ9: No data available for the requested date range".

Is there a way to parse this error from the dataFrame?

Note: when I request only 1 ticker at a time, python module raises EikonError. And I can catch it and parse the description. For multiply tickers it just prints to the std.

Best Answer

Answers

  • does it log something by default?

  • @alex, how can I make eikon to log the error to the file?

    I see there is set_log_level function.

    >>> ek.set_log_path("../log")
    >>> ek.set_log_level(logging.DEBUG)
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "C:\Program Files (x86)\Python37-32\Lib\site-packages\eikon\Profile.py", line 133, in set_log_level
    get_profile().set_log_level(level)
    File "C:\Program Files (x86)\Python37-32\Lib\site-packages\eikon\Profile.py", line 296, in set_log_level
    __handler = logging.handlers.RotatingFileHandler(__filename, mode='a', maxBytes=MAX_LOG_SIZE,
    NameError: name 'MAX_LOG_SIZE' is not defined

    What am I doing wrong?

  • You're not doing anything wrong. There's a bug in Profile.py module, which results in the error you saw and which makes it not possible to output the log to a file using methods in eikon library v0.1.13. The bug is fixed in v0.1.14, but this update hasn't been published yet and I'm not sure when it will be published. Currently the only way you can catch the error logged for an individual RIC when using get_timeseries method with multiple RICs, is by implementing a handler for the logger as described in the article I referenced in my response on the other thread that I mentioned earlier.

  • understood. thank you