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:
Rushi Agrawal
2021-08-19 09:48:02 +05:30
parent ed73459f05
commit 3eac282c57
7 changed files with 6 additions and 51 deletions
+1 -2
View File
@@ -19,11 +19,10 @@ jobs:
strategy:
fail-fast: false
matrix:
stack_version: ['7.10.2']
cluster: ["opendistro", "opensearch"]
steps:
- name: Checkout
uses: actions/checkout@v2
- run: "./.ci/run-tests ${{ matrix.cluster }} "
name: Integ ${{ matrix.stack_version }} ${{ matrix.cluster }}
name: Integ ${{ matrix.cluster }}
+1 -1
View File
@@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
stack_version: ['7.10.2']
stack_version: ['1.0.0']
steps:
- name: Checkout
+1 -1
View File
@@ -24,4 +24,4 @@
# specific language governing permissions and limitations
# under the License.
__versionstr__ = "7.10.2"
__versionstr__ = "1.0.0"
+1 -9
View File
@@ -28,7 +28,6 @@ import binascii
import gzip
import io
import logging
import os
import re
import warnings
from platform import python_version
@@ -38,7 +37,7 @@ try:
except ImportError:
import json
from .. import __version__, __versionstr__
from .. import __versionstr__
from ..exceptions import (
HTTP_EXCEPTIONS,
ImproperlyConfigured,
@@ -128,13 +127,6 @@ class Connection(object):
if 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("user-agent", self._get_default_user_agent())
+2 -6
View File
@@ -163,12 +163,8 @@ class Deserializer(object):
if not mimetype:
deserializer = self.default
else:
# split out 'charset' and 'compatible-width' options
mimetype = mimetype.partition(";")[0].strip()
# Treat 'application/vnd.opensearch+json'
# as application/json for compatibility.
if mimetype == "application/vnd.opensearch+json":
mimetype = "application/json"
# split out charset
mimetype, _, _ = mimetype.partition(";")
try:
deserializer = self.serializers[mimetype]
except KeyError:
-21
View File
@@ -28,7 +28,6 @@
import gzip
import io
import json
import os
import re
import ssl
import warnings
@@ -174,26 +173,6 @@ class TestBaseConnection(TestCase):
conn = Connection(**kwargs)
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):
def _get_mock_connection(self, connection_params={}, response_body=b"{}"):
-11
View File
@@ -226,17 +226,6 @@ class TestDeserializer(TestCase):
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):
self.assertRaises(SerializationError, self.de.loads, "{}", "text/html")