Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finally found the Tasks API warning bug #8

Merged
merged 1 commit into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/es_wait/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Top-level init file"""

__version__ = '0.9.2'
__version__ = '0.9.3'
from .exists import Exists
from .health import Health
from .index import Index
Expand Down
6 changes: 6 additions & 0 deletions src/es_wait/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import typing as t
import logging
import warnings
from time import localtime, strftime
from dotmap import DotMap # type: ignore
from elasticsearch8.exceptions import GeneralAvailabilityWarning
from ._base import Waiter

if t.TYPE_CHECKING:
Expand Down Expand Up @@ -72,6 +74,10 @@ def check(self) -> bool:

response = {}
try:
# The Tasks API is not yet GA. We need to suppress the warning for now.
# This is required after elasticsearch8>=8.16.0 as the warning is raised
# from that release onward.
warnings.filterwarnings("ignore", category=GeneralAvailabilityWarning)
response = dict(self.client.tasks.get(task_id=self.task_id))
except Exception as err:
msg = (
Expand Down