mirror of
https://github.com/elastic/eland.git
synced 2025-07-11 00:02:14 +08:00
Fix mypy type errors for elasticsearch-python v8.0.0
This commit is contained in:
parent
5c5e5af54d
commit
5678525b15
@ -15,7 +15,7 @@
|
|||||||
# specific language governing permissions and limitations
|
# specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union, cast
|
from typing import TYPE_CHECKING, Any, Dict, List, Mapping, Optional, Tuple, Union, cast
|
||||||
|
|
||||||
import elasticsearch
|
import elasticsearch
|
||||||
import numpy as np
|
import numpy as np
|
||||||
@ -129,7 +129,7 @@ class MLModel:
|
|||||||
>>> # Delete model from Elasticsearch
|
>>> # Delete model from Elasticsearch
|
||||||
>>> es_model.delete_model()
|
>>> es_model.delete_model()
|
||||||
"""
|
"""
|
||||||
docs = []
|
docs: List[Mapping[str, Any]] = []
|
||||||
if isinstance(X, np.ndarray):
|
if isinstance(X, np.ndarray):
|
||||||
|
|
||||||
def to_list_or_float(x: Any) -> Union[List[Any], float]:
|
def to_list_or_float(x: Any) -> Union[List[Any], float]:
|
||||||
|
@ -19,7 +19,7 @@ import base64
|
|||||||
import json
|
import json
|
||||||
import math
|
import math
|
||||||
import os
|
import os
|
||||||
from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Set, Tuple, Union
|
from typing import TYPE_CHECKING, Any, Iterable, List, Mapping, Set, Tuple, Union
|
||||||
|
|
||||||
from tqdm.auto import tqdm # type: ignore
|
from tqdm.auto import tqdm # type: ignore
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ class PyTorchModel:
|
|||||||
|
|
||||||
def infer(
|
def infer(
|
||||||
self,
|
self,
|
||||||
docs: List[Dict[str, str]],
|
docs: List[Mapping[str, str]],
|
||||||
timeout: str = DEFAULT_TIMEOUT,
|
timeout: str = DEFAULT_TIMEOUT,
|
||||||
) -> Any:
|
) -> Any:
|
||||||
return self._client.options(
|
return self._client.options(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user