Skip to content

Commit

Permalink
fix: context var using default mutable value (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhordynski authored Nov 29, 2024
1 parent 250ea70 commit ffbcc68
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/ragbits-core/src/ragbits/core/audit/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ def __init__(self) -> None:
Constructs a new TraceHandler instance.
"""
super().__init__()
self._spans = ContextVar[list[SpanT]]("_spans", default=[])
self._spans = ContextVar[list[SpanT]]("_spans")
self._spans.set([])

@abstractmethod
def start(self, name: str, inputs: dict, current_span: SpanT | None = None) -> SpanT:
Expand Down

0 comments on commit ffbcc68

Please sign in to comment.