-
Notifications
You must be signed in to change notification settings - Fork 13.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
[AIRFLOW-2860] Update tests for druid hook #3710
Conversation
- Also assert that timeout is >= 1
Codecov Report
@@ Coverage Diff @@
## master #3710 +/- ##
===========================================
+ Coverage 17.69% 77.56% +59.86%
===========================================
Files 204 204
Lines 15766 15768 +2
===========================================
+ Hits 2790 12230 +9440
+ Misses 12976 3538 -9438
Continue to review full report at Codecov.
|
airflow/hooks/druid_hook.py
Outdated
@@ -53,6 +54,8 @@ def __init__( | |||
self.max_ingestion_time = max_ingestion_time | |||
self.header = {'content-type': 'application/json'} | |||
|
|||
assert self.timeout >= 1 |
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 would prefer not to put assert outside of test code. Could you change it to throw exception when timeout is less than 1?
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.
Also please use self.assertXXX otherwise we won't see causes.
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.
Strike that, missed the location. I would handle this as a ValueError though
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.
@awelsh93
Can you change this line to:
if self.timeout < 1:
raise ValueError("Druid timeout should be equal or greater than 1")
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.
Done - thanks
I think this pr is blocking (as in it is required for) #3708 I cannot get beyond the submit timeout test. |
Thanks for merging this - can the change in #3707 get another review please? It was merged but then reverted due to tests failing which have now been fixed in this pull request. |
Make sure you have checked all steps below.
Jira
Description
This pull request updates the tests for
airflow/hooks/druid_hook.py
and also adds an assert so thattimeout
must be greater than or equal to 1 second. This should fix the failing build in #3707.Tests
I ran
nosetests /tests/hooks/test_druid_hook.py
Commits
Documentation
Code Quality
git diff upstream/master -u -- "*.py" | flake8 --diff