Skip to content

Commit ba6cfe6

Browse files
committed
test
1 parent 34defc9 commit ba6cfe6

File tree

2 files changed

+7
-20
lines changed

2 files changed

+7
-20
lines changed

weave/trace/op.py

+2-15
Original file line numberDiff line numberDiff line change
@@ -388,19 +388,6 @@ def add(a: int, b: int) -> int:
388388
)
389389

390390

391-
def _placeholder_call() -> Call:
392-
# Import here to avoid circular dependency
393-
from weave.trace.weave_client import Call
394-
395-
return Call(
396-
_op_name="",
397-
trace_id="",
398-
project_id="",
399-
parent_id=None,
400-
inputs={},
401-
)
402-
403-
404391
def _do_call(
405392
op: Op,
406393
*args: Any,
@@ -409,7 +396,7 @@ def _do_call(
409396
**kwargs: Any,
410397
) -> tuple[Any, Call]:
411398
func = op.resolve_fn
412-
call = _placeholder_call()
399+
call = Call()
413400

414401
pargs = None
415402
if op._on_input_handler is not None:
@@ -481,7 +468,7 @@ async def _do_call_async(
481468
**kwargs: Any,
482469
) -> tuple[Any, Call]:
483470
func = op.resolve_fn
484-
call = _placeholder_call()
471+
call = Call()
485472

486473
# Handle all of the possible cases where we would skip tracing.
487474
if settings.should_disable_weave():

weave/trace/weave_client.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -499,11 +499,11 @@ class CallDict(TypedDict):
499499
class Call:
500500
"""A Call represents a single operation that was executed as part of a trace."""
501501

502-
_op_name: str | Future[str]
503-
trace_id: str
504-
project_id: str
505-
parent_id: str | None
506-
inputs: dict
502+
_op_name: str | Future[str] = ""
503+
trace_id: str = ""
504+
project_id: str = ""
505+
parent_id: str | None = None
506+
inputs: dict = dataclasses.field(default_factory=dict)
507507
id: str | None = None
508508
output: Any = None
509509
exception: str | None = None

0 commit comments

Comments
 (0)