Skip to content

Commit 9ea2e21

Browse files
authored
fix: filter None values from OpenTelemetry attributes (#1567)
* fix: filter None values from OpenTelemetry attributes * moved filtering out before return value
1 parent fa6e13d commit 9ea2e21

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

google/cloud/bigquery/opentelemetry_tracing.py

+5
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ def _get_final_span_attributes(attributes=None, client=None, job_ref=None):
9797
final_attributes.update(job_attributes)
9898
if attributes:
9999
final_attributes.update(attributes)
100+
101+
filtered = {k: v for k, v in final_attributes.items() if v is not None}
102+
final_attributes.clear()
103+
final_attributes.update(filtered)
104+
100105
return final_attributes
101106

102107

0 commit comments

Comments
 (0)