-
Notifications
You must be signed in to change notification settings - Fork 801
Deprecation warnings in elasticsearch 8.12.0 with current version 8.12.0 of this library #1711
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
Comments
Hey @robinmuhia, thanks for reading the guidelines and reaching out! I'm surprised about the In any case, yes, if the latest version of this library is emitting warnings, we need to fix them, and I'd appreciate your help. I think the best way to proceed forward is to write a test for each warning to prove that a warning is emitted. (The CI is designed to fail on warnings.) I fixed one already: 40e1632 but would be happy to fix the rest. Does that make sense? |
Thanks for the reply. I will work on it over the weekend and get back to you. |
Sounds great! Please start with a single warning and share your work early to make sure it's the right direction to avoid wasted work. |
Apologies. After further investigation, i realized pip was installing an older cached version and not the current 8.12.0. That explains the body warnings. But i still get the options warning. As seen below .
This specific line causes the warning def delete(self, using=None, **kwargs):
"""
Deletes the index in elasticsearch.
Any additional keyword arguments will be passed to
``Elasticsearch.indices.delete`` unchanged.
"""
return self._get_connection(using).indices.delete(index=self._name, **kwargs) My conftest.py has the following code that is called in between test cases so the delete part calls the function above. from elasticsearch import Elasticsearch
@pytest.fixture(autouse=True)
def clear_elasticsearch_indices(settings):
"""
Fixture to clear all Elasticsearch indices after each test case.
"""
es = Elasticsearch(hosts=settings.ELASTICSEARCH_DSL["default"]["hosts"])
indices = es.options().indices.get_alias(index="*").keys()
for index_name in indices:
es.options(ignore_status=[404,400]).indices.delete(index=index_name)
yield |
How can this be reproduced? Running the test using Indeed, as you can see in That said, this issue made me realize that I had forgotten to stop ignoring body warnings when running tests, so I opened #1712. |
I will make a mini project with similar implementation and get back to you |
To be clear it is possible to pass transport options today to delete() and other functions. It will trigger a warning but it will be up to the user of the library to fix it. |
Hey, I am getting back to you. After doing some deep dive into the issue, it was a third party library that was causing the issue so i will just close this issue. Thanks for your guidance. |
Thank you for circling back! Glad I could help. |
Uh oh!
There was an error while loading. Please reload this page.
The current latest version of elastic search -dsl has numerous deprecation warnings with regards to passing of the body parameter and transport options to elasticsearch. I am willing to contribute to fix the current implementation to match elasticsearch library's recommendations if no one is on it at the time. A snippet of such warnings is found below:
I have read the contributing guidelines which state i first have to open an issue before contributing.
The text was updated successfully, but these errors were encountered: