Skip to content

Conversation

@hassiebp
Copy link
Contributor

@hassiebp hassiebp commented Nov 19, 2025

Important

URL encode dataset names in get_dataset() in client.py to handle special characters.

  • Behavior:
    • Modify get_dataset() in client.py to URL encode dataset_name using _url_encode() before calling self.api.datasets.get().
  • Misc:
    • No changes to other files or functions.

This description was created by Ellipsis for 857b689. You can customize this summary. It will automatically update as commits are pushed.

Disclaimer: Experimental PR review

Greptile Summary

  • Fixed URL encoding for dataset names in get_dataset() method to properly handle special characters
  • Change is consistent with existing pattern used for prompt names (lines 3577, 3747)

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • The change is a simple bug fix that adds proper URL encoding for dataset names, following the exact pattern already used successfully for prompt names. No breaking changes or side effects expected.
  • No files require special attention

Sequence Diagram

sequenceDiagram
    participant User
    participant Langfuse as "Langfuse.get_dataset()"
    participant URLEncoder as "_url_encode()"
    participant API as "api.datasets.get()"
    participant HTTPClient as "httpx_client"
    participant Server as "Langfuse API"
    
    User->>Langfuse: "get_dataset(name)"
    Langfuse->>URLEncoder: "_url_encode(name)"
    URLEncoder-->>Langfuse: "encoded_name"
    Langfuse->>API: "datasets.get(dataset_name=encoded_name)"
    API->>HTTPClient: "GET /api/public/v2/datasets/{encoded_name}"
    HTTPClient->>Server: "HTTP Request"
    Server-->>HTTPClient: "Dataset Response"
    HTTPClient-->>API: "Response"
    API-->>Langfuse: "Dataset Object"
    Langfuse->>API: "dataset_items.list(dataset_name, page, limit)"
    API->>HTTPClient: "GET /api/public/dataset-items?datasetName=..."
    HTTPClient->>Server: "HTTP Request"
    Server-->>HTTPClient: "Dataset Items Response"
    HTTPClient-->>API: "Response"
    API-->>Langfuse: "Dataset Items"
    Langfuse-->>User: "DatasetClient with items"
Loading

@hassiebp hassiebp enabled auto-merge (squash) November 19, 2025 17:39
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile
React with 👍 or 👎 to share your feedback on this new summary format

@hassiebp hassiebp disabled auto-merge November 19, 2025 17:49
@hassiebp hassiebp merged commit e969036 into main Nov 19, 2025
12 checks passed
@hassiebp hassiebp deleted the fix-dataset-url-encoding branch November 19, 2025 17:49
@simon376
Copy link

I am still facing this issue.
calling langfuse.get_dataset(name="KNOWN_ISSUES/DAI-268") gives a bad request 400 error. Running self-hosted v3.140.0 OSS` and python SDK 3.10.6

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.

3 participants