Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yahoo and Stooq importer tests are failing #5

Closed
hansmbakker opened this issue Jul 4, 2017 · 6 comments
Closed

Yahoo and Stooq importer tests are failing #5

hansmbakker opened this issue Jul 4, 2017 · 6 comments
Assignees
Labels

Comments

@hansmbakker
Copy link
Contributor

The ImportByYahoo and ImportByStooq tests are failing, probably because the decimal point gets lost somewhere

@fernaramburu
Copy link
Contributor

@Wind-rider Thanks! I will re-check that. Main branch or which one? Can you just tell me your Culture? I'm asking this because I detected some test where failing for es-XX (Spanish, we use inverted , and . in numbers) and I fixed some of the tests but not all.

Thanks!

Fer

@hansmbakker
Copy link
Contributor Author

Main branch, culture is probably nl-nl.

I don't know how the parsing is done now, but I assume that the culture should not influence the parsing.

@fernaramburu
Copy link
Contributor

Hi @Wind-rider .
Parsing is about Culture... or Culture is about parsing :)

Just do a single test with a decimal.Parse("3.456") in Argentina where we use comma for decimal separations and that will return 3456m while if you do it in United States (just to give an example) it will return 3.456m.

Looks like both Yahoo Finance API library and StooqAPI library are using the CultureInfo.CurrentCulture. If you want those libraries to work you need to the set the culture. I just make a commit to proves that. We will see if we fix it or we leave that way and the user set the culture as they need as for users who have machines configured with the '.' as decimal separation they don't see that issue. I mean, I can't decide as @lppkarl actually has access or had written code in those libraries and maybe he is able to quickly fix them.

You may check to see Nuba.Finance.Google and the importer that is being done by @lppkarl . That library shouldn't be getting that kind of exceptions as the library itself use its own Culture for parsing.

Hope this help till we see if we implement a tricky solution for each call to those importers.

@hansmbakker
Copy link
Contributor Author

That is exactly what I meant - a parser should do its work independent from the computer it runs on (CurrentCulture).

So the parser should either use InvariantCulture or stick to a specific culture.

@hansmbakker
Copy link
Contributor Author

The Yahoo API (and other APIs) always responds in the same way, so the user shouldn't be required to set a culture for it.

@karlwancl
Copy link
Owner

@Wind-rider yea you're right. I'm missing the InvariantCulture there, will be adding to it soon, thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants