Skip to content

Commit 83c90c3

Browse files
committed
Fixed Flake8 issues
1 parent 7580b23 commit 83c90c3

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

pydruid/client.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
import re
2222

2323
from six.moves import urllib
24+
from pydruid.query import QueryBuilder
25+
from base64 import b64encode
2426

2527
if sys.version_info.major == 2 and sys.version_info.minor == 7:
2628
import StringIO
@@ -36,11 +38,7 @@ def decompress(data):
3638

3739

3840
else:
39-
from gzip import compress, decompress
40-
41-
from pydruid.query import QueryBuilder
42-
from base64 import b64encode
43-
41+
from gzip import decompress
4442

4543
# extract error from the <PRE> tag inside the HTML response
4644
HTML_ERROR = re.compile("<pre>\\s*(.*?)\\s*</pre>", re.IGNORECASE)

tests/test_client.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def compress(data):
2323

2424

2525
else:
26-
from gzip import compress, decompress
26+
from gzip import compress
2727

2828

2929
def create_client(headers=None):
@@ -76,8 +76,10 @@ def test_druid_returns_html_error(self, mock_urlopen):
7676
<body>
7777
<h2>HTTP ERROR: 500</h2>
7878
<p>Problem accessing /druid/v2/. Reason:
79-
<pre> javax.servlet.ServletException: java.lang.OutOfMemoryError: GC overhead limit exceeded</pre></p>
80-
<hr /><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.3.19.v20170502</a><hr/>
79+
<pre> javax.servlet.ServletException: java.lang.OutOfMemoryError: GC
80+
overhead limit exceeded</pre></p>
81+
<hr /><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.3.19.v20170502
82+
</a><hr/>
8183
</body>
8284
</html>
8385
"""
@@ -104,7 +106,8 @@ def test_druid_returns_html_error(self, mock_urlopen):
104106
== textwrap.dedent(
105107
"""
106108
HTTP Error 500: Internal Server Error
107-
Druid Error: javax.servlet.ServletException: java.lang.OutOfMemoryError: GC overhead limit exceeded
109+
Druid Error: javax.servlet.ServletException: java.lang.OutOfMemoryError: GC
110+
overhead limit exceeded
108111
Query is: {
109112
"aggregations": [
110113
{
@@ -201,7 +204,8 @@ def test_client_allows_to_export_last_query(self, mock_urlopen):
201204
)
202205

203206
# when / then
204-
# assert that last_query.export_tsv method was called (it should throw an exception, given empty path)
207+
# assert that last_query.export_tsv method was called (it should throw an
208+
# exception, given empty path)
205209
with pytest.raises(TypeError):
206210
client.export_tsv(None)
207211

0 commit comments

Comments
 (0)