Skip to content

Commit dcfed95

Browse files
committed
Fix linter issues
1 parent 6c698c4 commit dcfed95

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

elasticsearch_serverless/_sync/client/_base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@
5757
from .utils import _TYPE_SYNC_SNIFF_CALLBACK, _base64_auth_header, _quote_query
5858

5959
_WARNING_RE = re.compile(r"\"([^\"]*)\"")
60-
_COMPAT_MIMETYPE_TEMPLATE = "application/vnd.elasticsearch+%s; compatible-with=8"
60+
_COMPAT_MIMETYPE_TEMPLATE = "application/vnd.elasticsearch+%s; compatible-with=" + str(
61+
__versionstr__.partition(".")[0]
62+
)
6163
_COMPAT_MIMETYPE_RE = re.compile(r"application/(json|x-ndjson|vnd\.mapbox-vector-tile)")
6264
_COMPAT_MIMETYPE_SUB = _COMPAT_MIMETYPE_TEMPLATE % (r"\g<1>",)
6365

test_elasticsearch_serverless/test_server/conftest.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
import elasticsearch_serverless
2323

24-
from ..utils import wipe_cluster, es_api_key
24+
from ..utils import es_api_key, wipe_cluster
2525

2626
# Information about the Elasticsearch instance running, if any
2727
# Used for
@@ -42,7 +42,9 @@ def sync_client_factory(elasticsearch_url):
4242

4343
# We do this little dance with the URL to force
4444
# Requests to respect 'headers: None' within rest API spec tests.
45-
client = elasticsearch_serverless.Elasticsearch(elasticsearch_url, api_key=es_api_key(), **kw)
45+
client = elasticsearch_serverless.Elasticsearch(
46+
elasticsearch_url, api_key=es_api_key(), **kw
47+
)
4648

4749
# Wipe the cluster before we start testing just in case it wasn't wiped
4850
# cleanly from the previous run of pytest?

test_elasticsearch_serverless/test_server/test_rest_api_spec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
from elasticsearch_serverless._sync.client.utils import _base64_auth_header
4343
from elasticsearch_serverless.compat import string_types
4444

45-
from ..utils import es_url, es_api_key, parse_version
45+
from ..utils import es_api_key, es_url, parse_version
4646

4747
# some params had to be changed in python, keep track of them so we can rename
4848
# those in the tests accordingly

test_elasticsearch_serverless/utils.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@
2121
from pathlib import Path
2222
from typing import Optional, Tuple
2323

24-
from elasticsearch_serverless import (
25-
Elasticsearch,
26-
RequestError,
27-
)
24+
from elasticsearch_serverless import Elasticsearch, RequestError
2825

2926
SOURCE_DIR = Path(__file__).absolute().parent.parent
3027

@@ -103,7 +100,7 @@ def wipe_data_streams(client):
103100
def wipe_indices(client):
104101
indices = client.cat.indices().strip().splitlines()
105102
if len(indices) > 0:
106-
index_names = [i.split(' ')[2] for i in indices]
103+
index_names = [i.split(" ")[2] for i in indices]
107104
client.options(ignore_status=404).indices.delete(
108105
index=",".join(index_names),
109106
expand_wildcards="all",

0 commit comments

Comments
 (0)