[7.x] Sort imports with isort and regenerate APIs

This commit is contained in:
Seth Michael Larson
2021-01-13 14:21:04 -06:00
committed by GitHub
parent e0e54a1128
commit a728aaa491
195 changed files with 1010 additions and 816 deletions
+3 -3
View File
@@ -18,10 +18,10 @@
from __future__ import print_function
import subprocess
import sys
from os import environ
from os.path import dirname, join, pardir, abspath, exists
import subprocess
from os.path import abspath, dirname, exists, join, pardir
def fetch_es_repo():
@@ -50,8 +50,8 @@ def fetch_es_repo():
if environ.get("TEST_ES_NOFETCH", False):
return
from test_elasticsearch.test_server import get_client
from test_elasticsearch.test_cases import SkipTest
from test_elasticsearch.test_server import get_client
# find out the sha of the running es
try:
@@ -16,18 +16,18 @@
# specific language governing permissions and limitations
# under the License.
import ssl
import gzip
import io
from mock import patch
import ssl
import warnings
from platform import python_version
import aiohttp
from multidict import CIMultiDict
import pytest
from elasticsearch import AIOHttpConnection
from elasticsearch import __versionstr__
import aiohttp
import pytest
from mock import patch
from multidict import CIMultiDict
from elasticsearch import AIOHttpConnection, __versionstr__
pytestmark = pytest.mark.asyncio
@@ -15,10 +15,13 @@
# specific language governing permissions and limitations
# under the License.
import os
import pytest
import asyncio
import os
import pytest
import elasticsearch
from ...utils import wipe_cluster
pytestmark = pytest.mark.asyncio
@@ -17,6 +17,7 @@
# under the License.
from __future__ import unicode_literals
import pytest
pytestmark = pytest.mark.asyncio
@@ -19,14 +19,14 @@
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information
import pytest
import asyncio
from mock import patch, MagicMock
from elasticsearch import helpers, TransportError
import pytest
from mock import MagicMock, patch
from elasticsearch import TransportError, helpers
from elasticsearch.helpers import ScanError
pytestmark = pytest.mark.asyncio
@@ -20,19 +20,21 @@ Dynamically generated set of TestCases based on set of yaml files decribing
some integration tests. These files are shared among all official Elasticsearch
clients.
"""
import pytest
import warnings
import inspect
import warnings
from elasticsearch import RequestError, ElasticsearchWarning
import pytest
from elasticsearch import ElasticsearchWarning, RequestError
from elasticsearch.helpers.test import _get_version
from ...test_server.test_rest_api_spec import (
YamlRunner,
IMPLEMENTED_FEATURES,
PARAMS_RENAMES,
RUN_ASYNC_REST_API_TESTS,
YAML_TEST_SPECS,
InvalidActionType,
RUN_ASYNC_REST_API_TESTS,
PARAMS_RENAMES,
IMPLEMENTED_FEATURES,
YamlRunner,
)
pytestmark = pytest.mark.asyncio
@@ -17,18 +17,19 @@
# under the License.
from __future__ import unicode_literals
import re
import asyncio
import json
from mock import patch
import re
import pytest
from mock import patch
from elasticsearch import AsyncTransport
from elasticsearch.connection import Connection
from elasticsearch.connection_pool import DummyConnectionPool
from elasticsearch.exceptions import ConnectionError, TransportError
pytestmark = pytest.mark.asyncio
+2 -1
View File
@@ -16,8 +16,9 @@
# under the License.
from collections import defaultdict
from unittest import TestCase
from unittest import SkipTest # noqa: F401
from unittest import TestCase
from elasticsearch import Elasticsearch
+3 -2
View File
@@ -16,11 +16,12 @@
# under the License.
from __future__ import unicode_literals
import warnings
from elasticsearch.client import _normalize_hosts, Elasticsearch
from elasticsearch.client import Elasticsearch, _normalize_hosts
from ..test_cases import TestCase, ElasticsearchTestCase
from ..test_cases import ElasticsearchTestCase, TestCase
class TestNormalizeHosts(TestCase):
@@ -17,6 +17,7 @@
# under the License.
import pytest
from test_elasticsearch.test_cases import ElasticsearchTestCase
+2 -2
View File
@@ -18,10 +18,10 @@
from __future__ import unicode_literals
from elasticsearch.client.utils import _bulk_body, _make_path, _escape, query_params
from elasticsearch.client.utils import _bulk_body, _escape, _make_path, query_params
from elasticsearch.compat import PY2
from ..test_cases import TestCase, SkipTest
from ..test_cases import SkipTest, TestCase
class TestQueryParams(TestCase):
+14 -15
View File
@@ -16,34 +16,33 @@
# specific language governing permissions and limitations
# under the License.
import re
import ssl
import gzip
import io
from mock import Mock, patch
import urllib3
from urllib3._collections import HTTPHeaderDict
import re
import ssl
import warnings
from requests.auth import AuthBase
from platform import python_version
import pytest
import urllib3
from mock import Mock, patch
from requests.auth import AuthBase
from urllib3._collections import HTTPHeaderDict
from elasticsearch.exceptions import (
TransportError,
ConflictError,
RequestError,
NotFoundError,
)
from elasticsearch import __versionstr__
from elasticsearch.connection import (
Connection,
RequestsHttpConnection,
Urllib3HttpConnection,
)
from elasticsearch.exceptions import (
ConflictError,
NotFoundError,
RequestError,
TransportError,
)
from elasticsearch import __versionstr__
from .test_cases import TestCase, SkipTest
from .test_cases import SkipTest, TestCase
CLOUD_ID_PORT_443 = "cluster:d2VzdGV1cm9wZS5henVyZS5lbGFzdGljLWNsb3VkLmNvbTo0NDMkZTdkZTlmMTM0NWU0NDkwMjgzZDkwM2JlNWI2ZjkxOWUk"
CLOUD_ID_KIBANA = "cluster:d2VzdGV1cm9wZS5henVyZS5lbGFzdGljLWNsb3VkLmNvbSQ4YWY3ZWUzNTQyMGY0NThlOTAzMDI2YjQwNjQwODFmMiQyMDA2MTU1NmM1NDA0OTg2YmZmOTU3ZDg0YTZlYjUxZg=="
+2 -2
View File
@@ -17,12 +17,12 @@
import time
from elasticsearch.connection import Connection
from elasticsearch.connection_pool import (
ConnectionPool,
RoundRobinSelector,
DummyConnectionPool,
RoundRobinSelector,
)
from elasticsearch.connection import Connection
from elasticsearch.exceptions import ImproperlyConfigured
from .test_cases import TestCase
+5 -3
View File
@@ -16,11 +16,13 @@
# specific language governing permissions and limitations
# under the License.
import mock
import time
import threading
import time
import mock
import pytest
from elasticsearch import helpers, Elasticsearch
from elasticsearch import Elasticsearch, helpers
from elasticsearch.helpers import actions
from elasticsearch.serializer import JSONSerializer
+4 -5
View File
@@ -18,22 +18,21 @@
import sys
import uuid
from datetime import datetime
from decimal import Decimal
import numpy as np
import pandas as pd
from elasticsearch.exceptions import ImproperlyConfigured, SerializationError
from elasticsearch.serializer import (
JSONSerializer,
Deserializer,
DEFAULT_SERIALIZERS,
Deserializer,
JSONSerializer,
TextSerializer,
)
from elasticsearch.exceptions import SerializationError, ImproperlyConfigured
from .test_cases import TestCase, SkipTest
from .test_cases import SkipTest, TestCase
class TestJSONSerializer(TestCase):
@@ -16,6 +16,7 @@
# under the License.
from unittest import SkipTest
from elasticsearch.helpers import test
from elasticsearch.helpers.test import ElasticsearchTestCase as BaseTestCase
@@ -17,8 +17,11 @@
import os
import time
import pytest
import elasticsearch
from ..utils import wipe_cluster
@@ -17,11 +17,11 @@
from mock import patch
from elasticsearch import helpers, TransportError
from elasticsearch import TransportError, helpers
from elasticsearch.helpers import ScanError
from . import ElasticsearchTestCase
from ..test_cases import SkipTest
from . import ElasticsearchTestCase
class FailingBulkClient(object):
@@ -20,16 +20,17 @@ Dynamically generated set of TestCases based on set of yaml files describing
some integration tests. These files are shared among all official Elasticsearch
clients.
"""
import sys
import re
import os
from os import walk, environ
from os.path import exists, join, dirname, pardir, relpath
import yaml
import re
import sys
import warnings
import pytest
from os import environ, walk
from os.path import dirname, exists, join, pardir, relpath
from elasticsearch import TransportError, RequestError, ElasticsearchWarning
import pytest
import yaml
from elasticsearch import ElasticsearchWarning, RequestError, TransportError
from elasticsearch.compat import string_types
from elasticsearch.helpers.test import _get_version
+3 -1
View File
@@ -17,15 +17,17 @@
# under the License.
from __future__ import unicode_literals
import json
import time
import pytest
from mock import patch
from elasticsearch.transport import Transport, get_host_info
from elasticsearch.connection import Connection
from elasticsearch.connection_pool import DummyConnectionPool
from elasticsearch.exceptions import ConnectionError, TransportError
from elasticsearch.transport import Transport, get_host_info
from .test_cases import TestCase
+13 -13
View File
@@ -15,28 +15,28 @@
# specific language governing permissions and limitations
# under the License.
from typing import Generator, Dict, Any, AsyncGenerator
from typing import Any, AsyncGenerator, Dict, Generator
from elasticsearch7 import (
Elasticsearch,
Transport,
RequestsHttpConnection,
ConnectionPool,
AIOHttpConnection,
AsyncElasticsearch,
AsyncTransport,
AIOHttpConnection,
ConnectionPool,
Elasticsearch,
RequestsHttpConnection,
Transport,
)
from elasticsearch7.helpers import (
scan,
streaming_bulk,
reindex,
bulk,
async_bulk,
async_reindex,
async_scan,
async_streaming_bulk,
async_reindex,
async_bulk,
bulk,
reindex,
scan,
streaming_bulk,
)
es = Elasticsearch(
[{"host": "localhost", "port": 9443}],
transport_class=Transport,
+5 -5
View File
@@ -15,21 +15,21 @@
# specific language governing permissions and limitations
# under the License.
from typing import AsyncGenerator, Dict, Any
from typing import Any, AsyncGenerator, Dict
from elasticsearch import (
AIOHttpConnection,
AsyncElasticsearch,
AsyncTransport,
AIOHttpConnection,
ConnectionPool,
)
from elasticsearch.helpers import (
async_bulk,
async_reindex,
async_scan,
async_streaming_bulk,
async_reindex,
async_bulk,
)
es = AsyncElasticsearch(
[{"host": "localhost", "port": 9443}],
transport_class=AsyncTransport,
+8 -8
View File
@@ -15,15 +15,15 @@
# specific language governing permissions and limitations
# under the License.
from typing import Generator, Dict, Any
from elasticsearch import (
Elasticsearch,
Transport,
RequestsHttpConnection,
ConnectionPool,
)
from elasticsearch.helpers import scan, streaming_bulk, reindex, bulk
from typing import Any, Dict, Generator
from elasticsearch import (
ConnectionPool,
Elasticsearch,
RequestsHttpConnection,
Transport,
)
from elasticsearch.helpers import bulk, reindex, scan, streaming_bulk
es = Elasticsearch(
[{"host": "localhost", "port": 9443}],
+1
View File
@@ -16,6 +16,7 @@
# under the License.
import pytest
from elasticsearch.utils import _client_meta_version
+1
View File
@@ -17,6 +17,7 @@
import os
import time
from elasticsearch import Elasticsearch, NotFoundError, RequestError