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

[bug]: exchange_rate: it does not work for GBP to USD #153

Open
2 tasks done
mcgizzle opened this issue Jun 18, 2024 · 1 comment
Open
2 tasks done

[bug]: exchange_rate: it does not work for GBP to USD #153

mcgizzle opened this issue Jun 18, 2024 · 1 comment
Labels
bug-bigfunction Report a bug in a BigFunction

Comments

@mcgizzle
Copy link

Check the bug has not already been reported

Edit function_name and the short error description in title above

  • I wrote the correct function name and a short error description in the title above

What happened and what did you expect?

select bigfunctions.eu.exchange_rate('GBP', 'USD') returns null

It works in all other cases I tested, even the reverse exchange_rate('USD', 'GBP') works

@mcgizzle mcgizzle added the bug-bigfunction Report a bug in a BigFunction label Jun 18, 2024
@unytics
Copy link
Owner

unytics commented Jul 24, 2024

Thanks a lot @mcgizzle for opening this issue.

I suspect this happens when there are too many calls to yahoo finance.

I improved the function by:

  • checking the country given in input against ISO 4217 country codes and do NOT calling yahoo finance if the country code is not valid.
  • improving the cache management by NOT storing None in cache if yfinance does not return expected result.

I hope it will solve the issue.

Can you please tell me if you encounter null values again?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-bigfunction Report a bug in a BigFunction
Projects
None yet
Development

No branches or pull requests

2 participants