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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
5 0 0 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-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpython
icon clock
10 |1500

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

Upvote
Accepted
39.2k 75 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 5.0 MiB each and 10.0 MiB total.

Upvotes
18k 21 12 20

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 5.0 MiB each and 10.0 MiB total.

Upvotes
5 0 0 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 5.0 MiB each and 10.0 MiB total.

Upvotes
5 0 0 1

Thanks Alex!

icon clock
10 |1500

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

Click below to post an Idea Post Idea