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

Data conversion bug?

Hello,

I am using EikonDataAPI 0.4.6 in .NET and this is a .NET Core 3.1 application.


When I run the below to query STL_IMPVLT field from the following two option chains, the first symbol works (0#1KWH2+) but the second symbol (0#1KWX1+) throws a data conversion error (the line with result2)


var eikon = EikonDataAPI.Eikon.CreateDataAPI();
//Set API key here
var result1 = eikon.GetData(new List<string>() { "0#1KWH2+" }, new List<String>() { "STL_IMPVLT" }, parameters: new Dictionary<string, string>() { });
var result2 = eikon.GetData(new List<string>() { "0#1KWX1+" }, new List<String>() { "STL_IMPVLT" }, parameters: new Dictionary<string, string>() { });


The error is

>System.FormatException: 'String '57.61' was not recognized as a valid Boolean.'

57.61 is one of the STL_IMPVLT (implied vol) value for one on a chain.. if I use .GetDataRaw() the query works fine, but for some reason .GetData() is throwing an error and trying to convert this to a Boolean.


This seems like an internal data conversion error. This seemed to happen for various option chains, not just the one I specified. Can you let me know how this can be fixed? I don't see anything else I can do on my side..


Thanks,

Steve


.net
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
79.3k 253 52 74

@stephen.cook

Thank you for reporting this error.

The library uses the DataFrame.LoadCsv Method to convert the response to the DataFrame.

By default, it uses only 10 rows to guess the data types.

I have fixed this issue in 0.4.7. The new version will use all rows to guess the data types.

047.png


047.png (12.4 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 1 2

That worked, thank you very much for the quick turnaround!

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.