-
Notifications
You must be signed in to change notification settings - Fork 39
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
Implement ECBrates source for exchange rates #82
base: master
Are you sure you want to change the base?
Conversation
Sounds like a good idea; I just tested this on my end and I'm getting empty response from the ECB API you're calling. I added the following check:
|
Reason seems to be that I ran this on a day without data available (Sunday) and it takes the current date by default:
|
@gpoul Actually, such instances are handled. When you run |
I can only say that I get this error when running it unmodified from your branch:
If I supply a date that returns data, then yes; it works:
My expectation was that if there is no most recent price it should return the latest price it can fetch including its date, no? That's at least how I saw other modules behave so far, but maybe I'm misunderstanding how it works. |
Please add a test. |
As @gpoul suggested a year ago (sorry for that), I made an adjustment which gives a latest available rate (instead of a dedicated exception) when there is no rate for a given date (weekends, holidays). @blais I also added a unit test. Pylint check fails due to lines too long in ecbrates_test.py, but these are API responses needed for tests. Other errors come from eastmoneyfund_test.py, not a subject to this PR. |
Please fix the linter errors and I'll rubberstamp this. |
@blais I fixed linter errors in my test, but it still fails on eastmoneyfund_test.py, which does not exist on my branch |
@blais I created PR #93 which fixes eastmoneyfund_test.py, though it fails another check. |
This source used ECB datasets directly (daily average spot rates). As they only provide EUR as the base currency, other pairs need to be calculated as XXX -> EUR -> YYY