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

[Fix] openapi_config deprecation warning incorrectly shown #327

Merged
merged 1 commit into from
Mar 29, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions pinecone/config/openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import certifi
import socket
import copy
import warnings

from urllib3.connection import HTTPConnection

Expand Down Expand Up @@ -34,7 +33,6 @@ def copy(cls, openapi_config: OpenApiConfiguration, api_key: str, host: str) ->
we don't modify those settings.
'''
copied = copy.deepcopy(openapi_config)
warnings.warn("Passing openapi_config is deprecated and will be removed in a future release. Please pass settings such as proxy_url, proxy_headers, ssl_ca_certs, and ssl_verify directly to the Pinecone constructor as keyword arguments. See the README at https://github.com/pinecone-io/pinecone-python-client for examples.", DeprecationWarning)

copied.api_key = {"ApiKeyAuth": api_key}
copied.host = host
Expand Down
6 changes: 4 additions & 2 deletions pinecone/control/pinecone.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import time
import warnings
from typing import Optional, Dict, Any, Union, List, cast, NamedTuple

from .index_host_store import IndexHostStore
Expand Down Expand Up @@ -174,8 +175,6 @@ def __init__(
pc.list_indexes()

```


"""
if config:
if not isinstance(config, Config):
Expand All @@ -194,6 +193,9 @@ def __init__(
**kwargs
)

if kwargs.get("openapi_config", None):
warnings.warn("Passing openapi_config is deprecated and will be removed in a future release. Please pass settings such as proxy_url, proxy_headers, ssl_ca_certs, and ssl_verify directly to the Pinecone constructor as keyword arguments. See the README at https://github.com/pinecone-io/pinecone-python-client for examples.", DeprecationWarning)

self.openapi_config = ConfigBuilder.build_openapi_config(self.config, **kwargs)
self.pool_threads = pool_threads

Expand Down