Skip to content

Commit

Permalink
Add missing error codes
Browse files Browse the repository at this point in the history
  • Loading branch information
pquentin committed Feb 12, 2025
1 parent cdbbc8e commit ab1aa35
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions elasticsearch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
from ._version import __versionstr__

# Ensure that a compatible version of elastic-transport is installed.
_version_groups = tuple(int(x) for x in re.search(r"^(\d+)\.(\d+)\.(\d+)", _elastic_transport_version).groups()) # type: ignore
_version_groups = tuple(int(x) for x in re.search(r"^(\d+)\.(\d+)\.(\d+)", _elastic_transport_version).groups()) # type: ignore[union-attr]
if _version_groups < (8, 0, 0) or _version_groups > (9, 0, 0):
raise ImportError(
"An incompatible version of elastic-transport is installed. Must be between "
"v8.0.0 and v9.0.0. Install the correct version with the following command: "
"$ python -m pip install 'elastic-transport>=8, <9'"
)

_version_groups = re.search(r"^(\d+)\.(\d+)\.(\d+)", __versionstr__).groups() # type: ignore
_version_groups = re.search(r"^(\d+)\.(\d+)\.(\d+)", __versionstr__).groups() # type: ignore[assignment, union-attr]
_major, _minor, _patch = (int(x) for x in _version_groups)
VERSION = __version__ = (_major, _minor, _patch)

Expand Down
2 changes: 1 addition & 1 deletion elasticsearch/_async/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ async def map_actions() -> AsyncIterable[_TYPE_BULK_ACTION_HEADER_AND_BODY]:
]
ok: bool
info: Dict[str, Any]
async for data, (ok, info) in azip( # type: ignore
async for data, (ok, info) in azip( # type: ignore[assignment, misc]
bulk_data,
_process_bulk_chunk(
client,
Expand Down
2 changes: 1 addition & 1 deletion elasticsearch/_sync/client/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def host_mapping_to_node_config(host: Mapping[str, Union[str, int]]) -> NodeConf
)
options["path_prefix"] = options.pop("url_prefix")

return NodeConfig(**options) # type: ignore
return NodeConfig(**options) # type: ignore[arg-type]


def cloud_id_to_node_configs(cloud_id: str) -> List[NodeConfig]:
Expand Down
2 changes: 1 addition & 1 deletion elasticsearch/helpers/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ def parallel_bulk(

class BlockingPool(ThreadPool):
def _setup_queues(self) -> None:
super()._setup_queues() # type: ignore
super()._setup_queues() # type: ignore[misc]
# The queue must be at least the size of the number of threads to
# prevent hanging when inserting sentinel values during teardown.
self._inqueue: Queue[
Expand Down

0 comments on commit ab1aa35

Please sign in to comment.