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
5 0 2 1

Suppress warning for no data available for requested period (python API)

When pulling time series with multiple RICs, often there may not be data for some periods requested. Eikon raises the warning:

Error with 'RIC NAME': No data available for the requested date range

For some requests, I'm comfortable with there being no data available and I would like to suppress the warning (albeit possibly not best practice). Is there a way please?

eikoneikon-data-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-api
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.

Upvote
Accepted
39.4k 77 11 27

@gthompson6

To suppress these warnings you can set the logging level for Eikon Data APIs library logger to CRITICAL:

import logging 
logger = logging.getLogger('pyeikon') 
logger.setLevel(logging.CRITICAL)
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
18.2k 21 13 21

Hi @gthompson6

You can put the API call in a try block.


ahs.png (116.6 KiB)
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
5 0 2 1

Thanks @chavalit.jintamalit for your suggestion. It's not so much suppressing the error, more the warning marked in red. While the code still executes, as you can imagine with many rics and multiple API calls, a Juypter notebook becomes a sea of red! Thanks

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
5 0 2 1

Thanks Alex!

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.

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.