Skip to content

Commit c7ed0bb

Browse files
Don't double iterate when redacting by changing the value.
Co-authored-by: Aaron Abbott <[email protected]>
1 parent 2793544 commit c7ed0bb

File tree

1 file changed

+1
-4
lines changed
  • instrumentation-genai/opentelemetry-instrumentation-google-genai/tests/generate_content

1 file changed

+1
-4
lines changed

instrumentation-genai/opentelemetry-instrumentation-google-genai/tests/generate_content/test_e2e.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,9 @@ def _should_redact_header(header_key):
116116

117117

118118
def _redact_headers(headers):
119-
to_redact = []
120119
for header_key in headers:
121120
if _should_redact_header(header_key.lower()):
122-
to_redact.append(header_key)
123-
for header_key in to_redact:
124-
headers[header_key] = "<REDACTED>"
121+
headers[header_key] = "<REDACTED>"
125122

126123

127124
def _before_record_request(request):

0 commit comments

Comments
 (0)