Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(weave): Allow Dataset to be constructed from Calls #3382

Merged
merged 7 commits into from
Jan 22, 2025

Conversation

andrewtruong
Copy link
Collaborator

@andrewtruong andrewtruong commented Jan 13, 2025

@circle-job-mirror
Copy link

circle-job-mirror bot commented Jan 13, 2025

@andrewtruong andrewtruong marked this pull request as ready for review January 13, 2025 04:45
@andrewtruong andrewtruong requested a review from a team as a code owner January 13, 2025 04:45
@andrewtruong andrewtruong requested a review from a team as a code owner January 13, 2025 17:43
@mdlinville mdlinville requested a review from J2-D2-3PO January 13, 2025 23:03
@@ -534,6 +534,13 @@ class ApplyScorerSuccess:
wc._send_score_call(self, score_call, scorer_ref_uri)
return apply_scorer_result

def to_dict(self) -> dict:
Copy link
Collaborator

@tssweeney tssweeney Jan 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would more concretely type this so that the dict coming out has strongly typed fields

d["op_name"] = self.op_name
d["display_name"] = self.display_name

return cast(CallDict, d)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this cast is not guaranteed. I would do something to at least validate the keys

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What case do you see missing here?

@@ -54,6 +55,11 @@ 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]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so much network traffic here. Hopefully in the future we can do something serverside

@andrewtruong andrewtruong merged commit b267e27 into master Jan 22, 2025
122 checks passed
@andrewtruong andrewtruong deleted the andrew/dataset-call branch January 22, 2025 21:04
@github-actions github-actions bot locked and limited conversation to collaborators Jan 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants