Rename 7.10.2 -> 1.0.0 everywhere
Renaming caused breakages in API versioning code, so removed that part because we will anyways be removing the whole Elastic API versioning logic in near future. Also removed unused variable in .github/workflows/integration.yml Signed-off-by: Rushi Agrawal <[email protected]>
This commit is contained in:
@@ -19,11 +19,10 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
stack_version: ['7.10.2']
|
|
||||||
cluster: ["opendistro", "opensearch"]
|
cluster: ["opendistro", "opensearch"]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- run: "./.ci/run-tests ${{ matrix.cluster }} "
|
- run: "./.ci/run-tests ${{ matrix.cluster }} "
|
||||||
name: Integ ${{ matrix.stack_version }} ${{ matrix.cluster }}
|
name: Integ ${{ matrix.cluster }}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
stack_version: ['7.10.2']
|
stack_version: ['1.0.0']
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
|||||||
@@ -24,4 +24,4 @@
|
|||||||
# specific language governing permissions and limitations
|
# specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
__versionstr__ = "7.10.2"
|
__versionstr__ = "1.0.0"
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ import binascii
|
|||||||
import gzip
|
import gzip
|
||||||
import io
|
import io
|
||||||
import logging
|
import logging
|
||||||
import os
|
|
||||||
import re
|
import re
|
||||||
import warnings
|
import warnings
|
||||||
from platform import python_version
|
from platform import python_version
|
||||||
@@ -38,7 +37,7 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from .. import __version__, __versionstr__
|
from .. import __versionstr__
|
||||||
from ..exceptions import (
|
from ..exceptions import (
|
||||||
HTTP_EXCEPTIONS,
|
HTTP_EXCEPTIONS,
|
||||||
ImproperlyConfigured,
|
ImproperlyConfigured,
|
||||||
@@ -128,13 +127,6 @@ class Connection(object):
|
|||||||
if opaque_id:
|
if opaque_id:
|
||||||
self.headers["x-opaque-id"] = opaque_id
|
self.headers["x-opaque-id"] = opaque_id
|
||||||
|
|
||||||
if os.getenv("ELASTIC_CLIENT_APIVERSIONING") == "1":
|
|
||||||
self.headers.setdefault(
|
|
||||||
"accept",
|
|
||||||
"application/vnd.opensearch+json;compatible-with=%s"
|
|
||||||
% (str(__version__[0]),),
|
|
||||||
)
|
|
||||||
|
|
||||||
self.headers.setdefault("content-type", "application/json")
|
self.headers.setdefault("content-type", "application/json")
|
||||||
self.headers.setdefault("user-agent", self._get_default_user_agent())
|
self.headers.setdefault("user-agent", self._get_default_user_agent())
|
||||||
|
|
||||||
|
|||||||
@@ -163,12 +163,8 @@ class Deserializer(object):
|
|||||||
if not mimetype:
|
if not mimetype:
|
||||||
deserializer = self.default
|
deserializer = self.default
|
||||||
else:
|
else:
|
||||||
# split out 'charset' and 'compatible-width' options
|
# split out charset
|
||||||
mimetype = mimetype.partition(";")[0].strip()
|
mimetype, _, _ = mimetype.partition(";")
|
||||||
# Treat 'application/vnd.opensearch+json'
|
|
||||||
# as application/json for compatibility.
|
|
||||||
if mimetype == "application/vnd.opensearch+json":
|
|
||||||
mimetype = "application/json"
|
|
||||||
try:
|
try:
|
||||||
deserializer = self.serializers[mimetype]
|
deserializer = self.serializers[mimetype]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
|||||||
@@ -28,7 +28,6 @@
|
|||||||
import gzip
|
import gzip
|
||||||
import io
|
import io
|
||||||
import json
|
import json
|
||||||
import os
|
|
||||||
import re
|
import re
|
||||||
import ssl
|
import ssl
|
||||||
import warnings
|
import warnings
|
||||||
@@ -174,26 +173,6 @@ class TestBaseConnection(TestCase):
|
|||||||
conn = Connection(**kwargs)
|
conn = Connection(**kwargs)
|
||||||
assert conn.host == expected_host
|
assert conn.host == expected_host
|
||||||
|
|
||||||
def test_compatibility_accept_header(self):
|
|
||||||
try:
|
|
||||||
conn = Connection()
|
|
||||||
assert "accept" not in conn.headers
|
|
||||||
|
|
||||||
os.environ["ELASTIC_CLIENT_APIVERSIONING"] = "0"
|
|
||||||
|
|
||||||
conn = Connection()
|
|
||||||
assert "accept" not in conn.headers
|
|
||||||
|
|
||||||
os.environ["ELASTIC_CLIENT_APIVERSIONING"] = "1"
|
|
||||||
|
|
||||||
conn = Connection()
|
|
||||||
assert (
|
|
||||||
conn.headers["accept"]
|
|
||||||
== "application/vnd.opensearch+json;compatible-with=7"
|
|
||||||
)
|
|
||||||
finally:
|
|
||||||
os.environ.pop("ELASTIC_CLIENT_APIVERSIONING")
|
|
||||||
|
|
||||||
|
|
||||||
class TestUrllib3Connection(TestCase):
|
class TestUrllib3Connection(TestCase):
|
||||||
def _get_mock_connection(self, connection_params={}, response_body=b"{}"):
|
def _get_mock_connection(self, connection_params={}, response_body=b"{}"):
|
||||||
|
|||||||
@@ -226,17 +226,6 @@ class TestDeserializer(TestCase):
|
|||||||
self.de.loads('{"some":"data"}', "text/plain; charset=whatever"),
|
self.de.loads('{"some":"data"}', "text/plain; charset=whatever"),
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_deserialize_compatibility_header(self):
|
|
||||||
for content_type in (
|
|
||||||
"application/vnd.opensearch+json;compatible-with=7",
|
|
||||||
"application/vnd.opensearch+json; compatible-with=7",
|
|
||||||
"application/vnd.opensearch+json;compatible-with=8",
|
|
||||||
"application/vnd.opensearch+json; compatible-with=8",
|
|
||||||
):
|
|
||||||
self.assertEqual(
|
|
||||||
{"some": "data"}, self.de.loads('{"some":"data"}', content_type)
|
|
||||||
)
|
|
||||||
|
|
||||||
def test_raises_serialization_error_on_unknown_mimetype(self):
|
def test_raises_serialization_error_on_unknown_mimetype(self):
|
||||||
self.assertRaises(SerializationError, self.de.loads, "{}", "text/html")
|
self.assertRaises(SerializationError, self.de.loads, "{}", "text/html")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user