Skip to content

Conversation

@hassiebp
Copy link
Contributor

@hassiebp hassiebp commented Jul 2, 2025

Important

Fix URL parameter encoding in client.py for compatibility with httpx version 0.28+ by modifying _url_encode function.

  • Behavior:
    • Modify _url_encode in client.py to skip re-quoting URL parameters if httpx version is 0.28 or higher.
    • Adds is_url_param argument to _url_encode to control this behavior.
  • Compatibility:
    • Ensures compatibility with httpx version 0.28+ by checking httpx.__version__.
  • Misc:
    • Import Version from packaging.version in client.py.

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

Greptile Summary

Disclaimer: Experimental PR review

Fixed URL parameter encoding compatibility issue with httpx >0.28 in the Python SDK to prevent double-encoding of URL parameters.

  • Modified _url_encode method in langfuse/_client/client.py to avoid double URL encoding, as httpx >0.28 now handles WHATWG-compliant encoding internally
  • Change ensures proper handling of special characters in API request URLs across different httpx versions

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.

LGTM

1 file reviewed, no comments
Edit PR Review Bot Settings | Greptile

@hassiebp hassiebp enabled auto-merge (squash) July 2, 2025 12:38
@hassiebp hassiebp merged commit 690f819 into main Jul 2, 2025
10 checks passed
@hassiebp hassiebp deleted the hassieb/lfe-4909-dataset-space branch July 2, 2025 12:39
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.

bug: Python SDK get_dataset() raises NotFoundError when dataset name contains a space bug: double escaping of HTTP query params with httpx 0.28+

2 participants