diff --git a/pinecone/config/openapi.py b/pinecone/config/openapi.py index b6b6f6e6..c8ba117a 100644 --- a/pinecone/config/openapi.py +++ b/pinecone/config/openapi.py @@ -4,7 +4,6 @@ import certifi import socket import copy -import warnings from urllib3.connection import HTTPConnection @@ -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 diff --git a/pinecone/control/pinecone.py b/pinecone/control/pinecone.py index 272f3eee..3fed74a5 100644 --- a/pinecone/control/pinecone.py +++ b/pinecone/control/pinecone.py @@ -1,4 +1,5 @@ import time +import warnings from typing import Optional, Dict, Any, Union, List, cast, NamedTuple from .index_host_store import IndexHostStore @@ -174,8 +175,6 @@ def __init__( pc.list_indexes() ``` - - """ if config: if not isinstance(config, Config): @@ -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