feat(client): add methods to langfuse client to fetch and delete dataset runs#1453
Merged
feat(client): add methods to langfuse client to fetch and delete dataset runs#1453
Conversation
hassiebp
reviewed
Nov 27, 2025
hassiebp
reviewed
Nov 27, 2025
hassiebp
reviewed
Nov 27, 2025
hassiebp
reviewed
Nov 27, 2025
… in Langfuse class
3 tasks
…ry is_url_param argument
|
Hi! I recently opened PR #1496 which was closed as a duplicate of this one. I noticed this PR has been waiting for updates since November. I'd be happy to help move this forward - I can submit the requested changes (keyword arguments + tests for URL encoding) either as commits to this branch or as a separate PR if that's easier. Let me know if there's anything I can do to help get this merged! |
Contributor
|
Hi Simon - thank you! This change has been released in our latest Python SDK version |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
Add methods to Langfuse client for fetching, listing, and deleting dataset runs, with tests for folder-format names, but fix URL encoding issues.
get_dataset_run: Fetches a single dataset run by dataset name and run name inclient.py.get_dataset_runs: Retrieves a paginated list of runs for a dataset inclient.py.delete_dataset_run: Permanently deletes a dataset run and all its items inclient.py.DatasetRunWithItems,DeleteDatasetRunResponse, andPaginatedDatasetRunstypes inclient.py.is_url_param=Trueflag in_url_encode()calls for path parameters in all three methods, potentially causing double-encoding issues.get_dataset_run,get_dataset_runs, anddelete_dataset_runwith folder-format names intest_datasets.py.This description was created by
for 617b4e7. You can customize this summary. It will automatically update as commits are pushed.
Disclaimer: Experimental PR review
Greptile Overview
Greptile Summary
Added three new methods to the Langfuse client for managing dataset runs:
get_dataset_run,get_dataset_runs, anddelete_dataset_run.get_dataset_run: fetches a single dataset run by dataset name and run nameget_dataset_runs: retrieves paginated list of runs for a datasetdelete_dataset_run: permanently deletes a dataset run and all its itemsDatasetRunWithItems,DeleteDatasetRunResponse, andPaginatedDatasetRunstypesIssues found:
is_url_param=Trueflag in_url_encode()calls for path parameters across all three methods. These parameters are embedded in URL paths and passed to httpx, which handles encoding automatically in v0.28+. This inconsistency with the existingget_datasetmethod (line 2445) could cause double-encoding issues.Confidence Score: 3/5
is_url_param=Trueflags could cause encoding issues with special characters in dataset/run names. The fix is simple but critical for correctness._url_encode()calls inlangfuse/_client/client.pyto includeis_url_param=Truefor all path parametersImportant Files Changed
File Analysis
get_dataset_run,get_dataset_runs,delete_dataset_run); missingis_url_param=Trueflag in URL encoding calls for path parametersSequence Diagram
sequenceDiagram participant User participant Langfuse participant API as Langfuse API Note over User,API: Get Dataset Run User->>Langfuse: get_dataset_run(dataset_name, run_name) Langfuse->>Langfuse: _url_encode(dataset_name) Langfuse->>Langfuse: _url_encode(run_name) Langfuse->>API: datasets.get_run(dataset_name, run_name) API-->>Langfuse: DatasetRunWithItems Langfuse-->>User: DatasetRunWithItems Note over User,API: Get Dataset Runs (Paginated) User->>Langfuse: get_dataset_runs(dataset_name, page, limit) Langfuse->>Langfuse: _url_encode(dataset_name) Langfuse->>API: datasets.get_runs(dataset_name, page, limit) API-->>Langfuse: PaginatedDatasetRuns Langfuse-->>User: PaginatedDatasetRuns Note over User,API: Delete Dataset Run User->>Langfuse: delete_dataset_run(dataset_name, run_name) Langfuse->>Langfuse: _url_encode(dataset_name) Langfuse->>Langfuse: _url_encode(run_name) Langfuse->>API: datasets.delete_run(dataset_name, run_name) API-->>Langfuse: DeleteDatasetRunResponse Langfuse-->>User: DeleteDatasetRunResponse