File tree Expand file tree Collapse file tree 4 files changed +10
-9
lines changed
elasticsearch_serverless/_sync/client
test_elasticsearch_serverless Expand file tree Collapse file tree 4 files changed +10
-9
lines changed Original file line number Diff line number Diff line change 57
57
from .utils import _TYPE_SYNC_SNIFF_CALLBACK , _base64_auth_header , _quote_query
58
58
59
59
_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
+ )
61
63
_COMPAT_MIMETYPE_RE = re .compile (r"application/(json|x-ndjson|vnd\.mapbox-vector-tile)" )
62
64
_COMPAT_MIMETYPE_SUB = _COMPAT_MIMETYPE_TEMPLATE % (r"\g<1>" ,)
63
65
Original file line number Diff line number Diff line change 21
21
22
22
import elasticsearch_serverless
23
23
24
- from ..utils import wipe_cluster , es_api_key
24
+ from ..utils import es_api_key , wipe_cluster
25
25
26
26
# Information about the Elasticsearch instance running, if any
27
27
# Used for
@@ -42,7 +42,9 @@ def sync_client_factory(elasticsearch_url):
42
42
43
43
# We do this little dance with the URL to force
44
44
# 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
+ )
46
48
47
49
# Wipe the cluster before we start testing just in case it wasn't wiped
48
50
# cleanly from the previous run of pytest?
Original file line number Diff line number Diff line change 42
42
from elasticsearch_serverless ._sync .client .utils import _base64_auth_header
43
43
from elasticsearch_serverless .compat import string_types
44
44
45
- from ..utils import es_url , es_api_key , parse_version
45
+ from ..utils import es_api_key , es_url , parse_version
46
46
47
47
# some params had to be changed in python, keep track of them so we can rename
48
48
# those in the tests accordingly
Original file line number Diff line number Diff line change 21
21
from pathlib import Path
22
22
from typing import Optional , Tuple
23
23
24
- from elasticsearch_serverless import (
25
- Elasticsearch ,
26
- RequestError ,
27
- )
24
+ from elasticsearch_serverless import Elasticsearch , RequestError
28
25
29
26
SOURCE_DIR = Path (__file__ ).absolute ().parent .parent
30
27
@@ -103,7 +100,7 @@ def wipe_data_streams(client):
103
100
def wipe_indices (client ):
104
101
indices = client .cat .indices ().strip ().splitlines ()
105
102
if len (indices ) > 0 :
106
- index_names = [i .split (' ' )[2 ] for i in indices ]
103
+ index_names = [i .split (" " )[2 ] for i in indices ]
107
104
client .options (ignore_status = 404 ).indices .delete (
108
105
index = "," .join (index_names ),
109
106
expand_wildcards = "all" ,
You can’t perform that action at this time.
0 commit comments