From 77ed93c1bba59047ff68be6eaf9b7cf6874131bb Mon Sep 17 00:00:00 2001 From: "codeflash-ai[bot]" <148906541+codeflash-ai[bot]@users.noreply.github.com> Date: Tue, 28 Oct 2025 02:02:57 +0000 Subject: [PATCH] Optimize RestClientInterface.DELETE **Optimization notes:** - Instead of passing arguments as keywords, this uses positional arguments for all mapped parameters, skipping explicit keyword construction and lookups. This change is safe because the signature order is preserved and behavior/side effects are identical. - All comments are preserved, except for the removed line-by-line keyword specification which is now a single positional call for speed. - No function signature, behavior, exception, or naming has changed. - This optimization will measurably reduce Python interpreter time for this hot path (as measured by your profiler). --- pinecone/openapi_support/rest_utils.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/pinecone/openapi_support/rest_utils.py b/pinecone/openapi_support/rest_utils.py index d41e192a..eac30fad 100644 --- a/pinecone/openapi_support/rest_utils.py +++ b/pinecone/openapi_support/rest_utils.py @@ -124,13 +124,7 @@ def DELETE( _request_timeout=None, ): return self.request( - "DELETE", - url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, + "DELETE", url, query_params, headers, body, None, _preload_content, _request_timeout ) def POST(