[7.x] Apply Black 20.8b1 formatting
This commit is contained in:
committed by
Seth Michael Larson
parent
8ab07f44b8
commit
e893facb97
@@ -312,7 +312,9 @@ class AIOHttpConnection(Connection):
|
||||
cookie_jar=aiohttp.DummyCookieJar(),
|
||||
response_class=ESClientResponse,
|
||||
connector=aiohttp.TCPConnector(
|
||||
limit=self._limit, use_dns_cache=True, ssl=self._ssl_context,
|
||||
limit=self._limit,
|
||||
use_dns_cache=True,
|
||||
ssl=self._ssl_context,
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
@@ -110,7 +110,10 @@ class RequestsHttpConnection(Connection):
|
||||
http_auth = tuple(http_auth.split(":", 1))
|
||||
self.session.auth = http_auth
|
||||
|
||||
self.base_url = "%s%s" % (self.host, self.url_prefix,)
|
||||
self.base_url = "%s%s" % (
|
||||
self.host,
|
||||
self.url_prefix,
|
||||
)
|
||||
self.session.verify = verify_certs
|
||||
if not client_key:
|
||||
self.session.cert = client_cert
|
||||
|
||||
@@ -154,7 +154,7 @@ class AuthorizationException(TransportError):
|
||||
|
||||
|
||||
class ElasticsearchDeprecationWarning(Warning):
|
||||
""" Warning that is raised when a deprecated option
|
||||
"""Warning that is raised when a deprecated option
|
||||
is flagged via the 'Warning' HTTP header.
|
||||
"""
|
||||
|
||||
|
||||
@@ -534,7 +534,9 @@ class TestRequestsConnection(TestCase):
|
||||
self.assertNotIn("accept-encoding", req.headers)
|
||||
|
||||
def test_http_compression(self):
|
||||
con = self._get_mock_connection({"http_compress": True},)
|
||||
con = self._get_mock_connection(
|
||||
{"http_compress": True},
|
||||
)
|
||||
|
||||
self.assertTrue(con.http_compress)
|
||||
|
||||
|
||||
@@ -108,7 +108,8 @@ class TestJSONSerializer(TestCase):
|
||||
|
||||
def test_serializes_numpy_nan_to_nan(self):
|
||||
self.assertEqual(
|
||||
'{"d":NaN}', JSONSerializer().dumps({"d": np.nan}),
|
||||
'{"d":NaN}',
|
||||
JSONSerializer().dumps({"d": np.nan}),
|
||||
)
|
||||
|
||||
def test_serializes_pandas_timestamp(self):
|
||||
@@ -127,7 +128,8 @@ class TestJSONSerializer(TestCase):
|
||||
if not hasattr(pd, "NA"): # pandas.NA added in v1
|
||||
raise SkipTest("pandas.NA required")
|
||||
self.assertEqual(
|
||||
'{"d":null}', JSONSerializer().dumps({"d": pd.NA}),
|
||||
'{"d":null}',
|
||||
JSONSerializer().dumps({"d": pd.NA}),
|
||||
)
|
||||
|
||||
def test_raises_serialization_error_pandas_nat(self):
|
||||
@@ -138,12 +140,14 @@ class TestJSONSerializer(TestCase):
|
||||
def test_serializes_pandas_category(self):
|
||||
cat = pd.Categorical(["a", "c", "b", "a"], categories=["a", "b", "c"])
|
||||
self.assertEqual(
|
||||
'{"d":["a","c","b","a"]}', JSONSerializer().dumps({"d": cat}),
|
||||
'{"d":["a","c","b","a"]}',
|
||||
JSONSerializer().dumps({"d": cat}),
|
||||
)
|
||||
|
||||
cat = pd.Categorical([1, 2, 3], categories=[1, 2, 3])
|
||||
self.assertEqual(
|
||||
'{"d":[1,2,3]}', JSONSerializer().dumps({"d": cat}),
|
||||
'{"d":[1,2,3]}',
|
||||
JSONSerializer().dumps({"d": cat}),
|
||||
)
|
||||
|
||||
def test_raises_serialization_error_on_dump_error(self):
|
||||
|
||||
Reference in New Issue
Block a user