Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtruong committed Jan 22, 2025
1 parent 5a83063 commit b9befdc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
1 change: 1 addition & 0 deletions weave/flow/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def from_obj(cls, obj: WeaveObject) -> Self:
rows=obj.rows,
)

@classmethod
def from_calls(cls, calls: Iterable[Call]) -> Self:
rows = [call.to_dict() for call in calls]
return cls(rows=rows)
Expand Down
25 changes: 16 additions & 9 deletions weave/trace/weave_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,15 +601,22 @@ class ApplyScorerSuccess:
return apply_scorer_result

def to_dict(self) -> CallDict:
d = {}
for field in dataclasses.fields(self):
if field.name.startswith("_"):
continue
d[field.name] = getattr(self, field.name)
d["op_name"] = self.op_name
d["display_name"] = self.display_name

return cast(CallDict, d)
return CallDict(
op_name=self.op_name,
trace_id=self.trace_id,
project_id=self.project_id,
parent_id=self.parent_id,
inputs=self.inputs,
id=self.id,
output=self.output,
exception=self.exception,
summary=self.summary,
display_name=self.display_name,
attributes=self.attributes,
started_at=self.started_at,
ended_at=self.ended_at,
deleted_at=self.deleted_at,
)


def make_client_call(
Expand Down

0 comments on commit b9befdc

Please sign in to comment.