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

Add get_test_results #301

Merged
merged 9 commits into from
Nov 20, 2023
Merged

Add get_test_results #301

merged 9 commits into from
Nov 20, 2023

Conversation

hinthornw
Copy link
Collaborator

No description provided.

Copy link
Contributor

@eyurtsev eyurtsev left a comment

Choose a reason for hiding this comment

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

Thank you thank you!!

execution_time = (
(r.end_time - r.start_time).total_seconds() if r.end_time else None
)
row["execution_time"] = execution_time
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: i prefer using .update in places like that so all the updates can be done in one statement

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Works for me

import pandas as pd # type: ignore

runs = self.list_runs(
project_id=project_id, project_name=project_name, execution_order=1
Copy link
Contributor

Choose a reason for hiding this comment

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

is this paginated?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ya

@@ -1165,6 +1165,50 @@ def read_project(
**response.json(), _host_url=self._host_url
)

def get_test_results(
self,
project_id: Optional[ID_TYPE] = None,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
project_id: Optional[ID_TYPE] = None,
*,
project_id: Optional[ID_TYPE] = None,

Copy link
Contributor

Choose a reason for hiding this comment

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

not sure if you like, but i like forcing named invocation for whatever could be a literal since it makes user code more readable (but longer to type), but I like typing more code

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's more consistent with the rest of the API so ya good point. I've grown tired of typing "project_id" so often

Copy link
Contributor

Choose a reason for hiding this comment

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

but it's an opportunity to not think about anything since and let muscle memory engage for a few seconds

python/langsmith/client.py Show resolved Hide resolved
hinthornw and others added 5 commits November 20, 2023 14:09
Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
@hinthornw hinthornw merged commit cd9defb into main Nov 20, 2023
4 checks passed
@hinthornw hinthornw deleted the wfh/bump branch November 20, 2023 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants