Skip to content

Commit 8986f47

Browse files
committed
Update code style to latest black
1 parent da5922f commit 8986f47

File tree

5 files changed

+19
-8
lines changed

5 files changed

+19
-8
lines changed

elasticsearch/_async/http_aiohttp.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,9 @@ async def _create_aiohttp_session(self):
331331
cookie_jar=aiohttp.DummyCookieJar(),
332332
response_class=ESClientResponse,
333333
connector=aiohttp.TCPConnector(
334-
limit=self._limit, use_dns_cache=True, ssl=self._ssl_context,
334+
limit=self._limit,
335+
use_dns_cache=True,
336+
ssl=self._ssl_context,
335337
),
336338
)
337339

elasticsearch/connection/http_requests.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,10 @@ def __init__(
110110
http_auth = tuple(http_auth.split(":", 1))
111111
self.session.auth = http_auth
112112

113-
self.base_url = "%s%s" % (self.host, self.url_prefix,)
113+
self.base_url = "%s%s" % (
114+
self.host,
115+
self.url_prefix,
116+
)
114117
self.session.verify = verify_certs
115118
if not client_key:
116119
self.session.cert = client_cert

elasticsearch/exceptions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class AuthorizationException(TransportError):
154154

155155

156156
class ElasticsearchDeprecationWarning(Warning):
157-
""" Warning that is raised when a deprecated option
157+
"""Warning that is raised when a deprecated option
158158
is flagged via the 'Warning' HTTP header.
159159
"""
160160

test_elasticsearch/test_connection.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,9 @@ def test_no_http_compression(self):
534534
self.assertNotIn("accept-encoding", req.headers)
535535

536536
def test_http_compression(self):
537-
con = self._get_mock_connection({"http_compress": True},)
537+
con = self._get_mock_connection(
538+
{"http_compress": True},
539+
)
538540

539541
self.assertTrue(con.http_compress)
540542

test_elasticsearch/test_serializer.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ def test_serializes_numpy_ndarray(self):
108108

109109
def test_serializes_numpy_nan_to_nan(self):
110110
self.assertEqual(
111-
'{"d":NaN}', JSONSerializer().dumps({"d": np.nan}),
111+
'{"d":NaN}',
112+
JSONSerializer().dumps({"d": np.nan}),
112113
)
113114

114115
def test_serializes_pandas_timestamp(self):
@@ -127,7 +128,8 @@ def test_serializes_pandas_na(self):
127128
if not hasattr(pd, "NA"): # pandas.NA added in v1
128129
raise SkipTest("pandas.NA required")
129130
self.assertEqual(
130-
'{"d":null}', JSONSerializer().dumps({"d": pd.NA}),
131+
'{"d":null}',
132+
JSONSerializer().dumps({"d": pd.NA}),
131133
)
132134

133135
def test_raises_serialization_error_pandas_nat(self):
@@ -138,12 +140,14 @@ def test_raises_serialization_error_pandas_nat(self):
138140
def test_serializes_pandas_category(self):
139141
cat = pd.Categorical(["a", "c", "b", "a"], categories=["a", "b", "c"])
140142
self.assertEqual(
141-
'{"d":["a","c","b","a"]}', JSONSerializer().dumps({"d": cat}),
143+
'{"d":["a","c","b","a"]}',
144+
JSONSerializer().dumps({"d": cat}),
142145
)
143146

144147
cat = pd.Categorical([1, 2, 3], categories=[1, 2, 3])
145148
self.assertEqual(
146-
'{"d":[1,2,3]}', JSONSerializer().dumps({"d": cat}),
149+
'{"d":[1,2,3]}',
150+
JSONSerializer().dumps({"d": cat}),
147151
)
148152

149153
def test_raises_serialization_error_on_dump_error(self):

0 commit comments

Comments
 (0)