-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Fix/dbt deps retry none answer #4225
Conversation
Allow retries when the answer is None
Allow retries when the answer from dbt deps is None
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.
Thanks for the contribution @b-per! This looks great to me. I'll look to see if there's an easy place to add a test, but by itself the code is probably good to go.
Just a few small things from
I think you could add a test to def test_connection_exception_retry_success(self):
Counter._reset()
connection_exception_retry(lambda: Counter._add_with_none_exception(), 5)
self.assertEqual(2, counter) # 2 = original attempt returned None, plus 1 retry
class Counter():
...
def _add_with_none_exception():
global counter
counter+=1
if counter < 2:
raise requests.exceptions.InvalidJSONError If you have a chance to do that today, great! If not, I'll try to get this merged ahead of v1.0.0-rc1, which we're planning to cut very soon. |
Thanks for the review @jtcohen6 I am not too sure why Looking at the other exceptions available I actually changed the one raised to |
@b-per I'm not sure why In any case, thanks for the quick follow-up! This is good to go |
Allow retries when the answer received after a
dbt deps
isNone
resolves #4178
Description
Add the logic to handle the case when the answer received is
None
.I picked the
requests
exceptionInvalidJSONError
to handle the situation but I am not sure if another one would be more suitable.I didn't add tests and wouldn't be too sure where to start if a test would need to be created. Happy to add one if it is required.
Checklist
CHANGELOG.md
and added information about my change