Skip to content

Commit 5521c47

Browse files
committed
reverting config changes
1 parent a15c9cc commit 5521c47

File tree

1 file changed

+8
-25
lines changed

1 file changed

+8
-25
lines changed

pinecone/config.py

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,11 @@
2323

2424

2525
def _set_sentry_tags(config: dict):
26-
if config['disable_error_reporting']:
27-
sentry_sdk.init()
28-
else:
29-
sentry_sdk.set_tag("package_version", CLIENT_VERSION)
30-
sentry_tag_names = ('environment', 'project_name', 'controller_host', 'username', 'user_label')
31-
for key, val in config.items():
32-
if key in sentry_tag_names:
33-
sentry_sdk.set_tag(key, val)
26+
sentry_sdk.set_tag("package_version", CLIENT_VERSION)
27+
sentry_tag_names = ('environment', 'project_name', 'controller_host', 'username', 'user_label')
28+
for key, val in config.items():
29+
if key in sentry_tag_names:
30+
sentry_sdk.set_tag(key, val)
3431

3532

3633
class ConfigBase(NamedTuple):
@@ -39,7 +36,6 @@ class ConfigBase(NamedTuple):
3936
project_name: str = ""
4037
controller_host: str = ""
4138
log_level: str = ""
42-
disable_error_reporting: bool = False
4339
openapi_config: OpenApiConfiguration = None
4440

4541

@@ -138,14 +134,6 @@ def reset(self, config_file=None, **kwargs):
138134
self._config = config
139135

140136
# Sentry
141-
disable_error_reporting = (
142-
kwargs.pop("disable_error_reporting", False)
143-
or os.getenv("PINECONE_ERROR_REPORTING")
144-
or file_config.pop("disable_error_reporting", False)
145-
or False
146-
)
147-
config = config._replace(disable_error_reporting=disable_error_reporting)
148-
self._config = config
149137
_set_sentry_tags({**whoami_response._asdict(), **self._config._asdict()})
150138

151139
def _preprocess_and_validate_config(self, config: dict) -> dict:
@@ -203,14 +191,10 @@ def OPENAPI_CONFIG(self):
203191
def LOG_LEVEL(self):
204192
return self._config.log_level
205193

206-
@property
207-
def DISABLE_ERROR_REPORTING(self):
208-
return self._config.disable_error_reporting
209-
210194

211195
@sentry
212196
def init(api_key: str = None, host: str = None, environment: str = None, project_name: str = None,
213-
log_level: str = None, openapi_config: OpenApiConfiguration = None, disable_error_reporting: bool = None,
197+
log_level: str = None, openapi_config: OpenApiConfiguration = None,
214198
config: str = "~/.pinecone", **kwargs):
215199
"""Initializes the Pinecone client.
216200
@@ -219,12 +203,11 @@ def init(api_key: str = None, host: str = None, environment: str = None, project
219203
:param environment: Optional. Deployment environment.
220204
:param project_name: Optional. Pinecone project name. Overrides the value that is otherwise looked up and used from the Pinecone backend.
221205
:param log_level: Optional. Set Pinecone log level.
222-
:param disable_error_reporting: Optional. Don't sent client errors to Pinecone.
223206
:param openapi_config: Optional. Set OpenAPI client configuration.
224207
:param config: Optional. An INI configuration file.
225208
"""
226209
Config.reset(project_name=project_name, api_key=api_key, controller_host=host, environment=environment,
227-
log_level=log_level, openapi_config=openapi_config, disable_error_reporting=disable_error_reporting,
210+
log_level=log_level, openapi_config=openapi_config,
228211
config_file=config, **kwargs)
229212
if not bool(Config.API_KEY):
230213
logger.warning("API key is required.")
@@ -233,4 +216,4 @@ def init(api_key: str = None, host: str = None, environment: str = None, project
233216
Config = _CONFIG()
234217

235218
# Init
236-
init()
219+
init()

0 commit comments

Comments
 (0)