-
Notifications
You must be signed in to change notification settings - Fork 63
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
[BUG] Client Builder is Deprecated #283
Comments
Also getting this issue. If it is deprecated then the docs haven't been updated either so don't know what the new way is. |
You're right, docs are missing, also per #257 (comment). Can someone please help? Working code in #271. |
The ClientBuilder is intentionally deprecated, and getting a deprecation warning is not a bug. You can continue to use it, but it will be removed in 3.0.0. This is a warning that it will go away, so gives you time to update your code to use the new approach. See https://github.com/opensearch-project/opensearch-php/blob/main/UPGRADING.md |
The documentation on the site needs updating then. See: https://opensearch.org/docs/latest/clients/php/#connecting-to-opensearch |
I opened opensearch-project/documentation-website#9158 for that one. @icsdevs if you can help update the docs here and https://github.com/opensearch-project/documentation-website that would be grand. |
Thank you for the fast and thoughtful response. I will follow the linked instruction to rewrite my code following the new Guidelines. Thank you for your work on this valuable project! |
I followed the upgrade but I still get:
These classes are used in the constructor of |
These are deprecation warnings not errors. They are informing you that these classes will be removed in 3.0.0. |
@michal-swietochowski-tg See https://github.com/opensearch-project/opensearch-php/blob/main/UPGRADING.md for code to replace the deprecations with that will get rid of the warnings. Let us know if that works. I'll close this since it's by design. |
Unfortunately, this guide is not running code. im using "name": "opensearch-project/opensearch-php",
"version": "2.4.0",
"name": "guzzlehttp/guzzle",
"version": "7.9.2", and inserting this code $client = (new \OpenSearch\GuzzleClientFactory())->create([
'base_uri' => 'https://localhost:9200',
'auth' => ['admin', getenv('OPENSEARCH_PASSWORD')],
'verify' => false,
]);
// Send a request to the 'info' endpoint.
$info = $client->info(); just results in the following: From what I was able to see, this stems from the fact that the I feel like these deprecated warning have been introtuced too early without a current working alternativ in the release. I also tried the Guzzle Example in the 2.4.0 samples file but this also results in deprecated warnings (SslNamespace to be exact) If im missing something I would be glad to hear about my shortcomings. Else I will wait for the next release Thank you for your work and assistance! |
You can always check docs at the 2.4.0 tag, at that version the UPGRADING.md is pretty clear. |
i see, i checked all the 2.4 versions except for the actual guide. thank you |
I followed the guide at your repository and all possible ways (Except symfony) in this 2.4.0 samples This does still produce deprecated warnings, because there are deprecated classes called in the Since we are required to implement error and also warning free code, we are not able to upgrade to 2.4.0 since it does not meet our requirements. Thank you for your answers and help, we will upgrade once 2.4.0 is warnings free or 2.5 releases with its new |
I re-opened this as I opened #295 to look at suppressing some of the deprecation warnings and ensuring we deprecate the methods on the Client object appropriately. |
What is the bug?
I used the clientBuilder to build my Client that handels my importing. This is my init code:
This now leads to a deprecated warning in the
ClientBuilder
as well as in theAbstractNamespace
I was not able to find any change report as to with what i should replace the ClientBuilder.
How can one reproduce the bug?
Build a client with the above code
What is the expected behavior?
I should get a Client without any warnings
What is your host/environment?
Ubuntu 20.04
The text was updated successfully, but these errors were encountered: