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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
9.7k 49 38 60

Changing the name of the item in the get_timeseries() call throws an exception​

The following get_timeseries() call to retrieve the S&P 500 index returns proper data:

However, if I simply change the name of the item to retrieve Microsoft data, the get_timeseries() call throws an exception.

Looking at the details of the above error, it seems there is no data available for MSFT.O. If that is the case, wouldn't returning a result with zero rows imply that?

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythontime-seriesexception
img1.png (9.2 KiB)
img2.png (47.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
166 10 17 21

Hi Nick, Microsoft got listed in March 1986, that's why you get an error...


msft.jpg (70.7 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.

Hi @Joris.Hoendervangers,

Thanks for the update. Yes, I was actually looking to see what would happen when I chose a date prior to them being listed. I was expecting no data, not an exception. When I use the get_data() call, the response is different:

img3.png (6.8 KiB)

Maybe this could be raised as an enhancement request?

Upvotes
9.7k 49 38 60

I just re-tested this functionality with the latest version at this time (0.1.13), and the error returned is much more descriptive:

If throwing an exception is the appropriate result if no data is available, I would expect consistent behavior when requesting using the get_data() function call. However, the get_data() doesn't throw an exception, it returns no data.


ahs.png (29.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.

@nick.zincone.1 What I can capture from your reply is that the result when there is no data available from get_data() and get_timeseries() functions are different, am I correct? What is the expected behavior? Should it be (1) throwing an exception only, or (2) no data only?

Please specify. So, @Joris.Hoendervangers can understand how Eikon Data API should behave against each particular situation and communicate with the Development team thereafter.

What the response should be is consistent. Both method calls should respond in the same way. What way do I suggest? Well in this case, both responses should return no data. Exceptions usually indicate something a little more severe like passing in a wrong type to the method call.

I agree with @nick.zincone.1. I think an exception is inappropriate here. It's worth noting that in the current implementation the exception is only thrown if there's no data for all RICs in the request. If the timeseries exist for at least one RIC in the request, then no exception is raised and the data is returned, but only for the RICs that have timeseries in the specified range. I would prefer if get_timeseries method returned a tuple with the dataframe and error like get_data method does.

I also would prefer if the dataframe returned by get_timeseries method contained empty strings or NaNs for the RICs that don't have timeseries in the specified range instead of current behavior that omits these RICs from the dataframe altogether.

Show more comments
Click below to post an Idea Post Idea