-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add safe fetch ohlcv dydx method #686
Add safe fetch ohlcv dydx method #686
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm approving this, subject to the small changes suggested.
Then go ahead and merge, once all tests pass.
@@ -55,6 +56,49 @@ def safe_fetch_ohlcv_ccxt( | |||
return None | |||
|
|||
|
|||
@enforce_types |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Main comment: overall this looks great! Low complexity, obvious to read. +10
My other comments are specific things.
100, | ||
) | ||
result = safe_fetch_ohlcv_dydx("dydx", symbol, timeframe, since, limit) | ||
assert_safe_fetch_ohlcv_dydx_ok(result) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this a separate function, vs just having the three lines here? Are you going to reuse it for more tests?
- If yes, ok.
- If no, move the three lines of the function into here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. Resolved: I moved the assertions into the unit test function test_safe_fetch_ohlcv_dydx().
def to_iso_timestr(self) -> str: | ||
dt: datetime = self.to_dt() | ||
|
||
return dt.strftime("%Y-%m-%dT%H:%M:%S.%f")[:-3] + "Z" # tack on timezone | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good.
And, this needs a unit test, next to the other time_types unit tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved: Added test_ut_to_iso_timestr() to test_time_types.py
… 2 test fn's to 1. Pytests are passing on local. Relinted.
…rametrization does not affect the dydx test. Relinted. Pytests passing on local.
…country restrictions
PR towards solving #493.
Changes proposed in this PR: