Upgrade from Eikon -> Workspace. Learn about programming differences.

For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
646 21 33 41

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.

eikoneikon-data-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-apitime-series
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
Accepted
39.4k 77 11 27

Please see my answer to a similar question on this thread.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

does it log something by default?

Upvotes
646 21 33 41

@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?

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.