Skip to content

Comments

fix(experiments): remove dataset version from run item request if None#1529

Merged
hassiebp merged 1 commit intomainfrom
fix-dataset-run-item-experiment-dataset-version
Feb 19, 2026
Merged

fix(experiments): remove dataset version from run item request if None#1529
hassiebp merged 1 commit intomainfrom
fix-dataset-run-item-experiment-dataset-version

Conversation

@hassiebp
Copy link
Contributor

@hassiebp hassiebp commented Feb 19, 2026

Important

Exclude None values from CreateDatasetRunItemRequest in _process_experiment_item() to prevent unnecessary data in requests.

  • Behavior:
    • Modify _process_experiment_item() in client.py to exclude None values from CreateDatasetRunItemRequest by using .dict(exclude_none=True). This prevents datasetVersion from being included if it is None.

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

Disclaimer: Experimental PR review

Greptile Summary

This PR fixes an issue where None values were being sent in dataset run item creation requests. The change adds .dict(exclude_none=True) when creating CreateDatasetRunItemRequest objects, ensuring that when datasetVersion is None, it is excluded from the API request payload.

Key Changes:

  • Modified _process_experiment_item() in client.py:2934 to call .dict(exclude_none=True) on the CreateDatasetRunItemRequest object
  • This prevents sending datasetVersion: None in the request when no dataset version is specified
  • The change is consistent with the Pydantic model's built-in behavior for handling optional fields

Technical Context:

  • The CreateDatasetRunItemRequest model already has a custom .dict() method that uses exclude_none by default (see create_dataset_run_item_request.py:51-66)
  • The HTTP client's jsonable_encoder properly handles both Pydantic models and dictionaries
  • When dataset_version parameter is None (which is the default), the field should not be included in the API request

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • The change is a small, well-scoped fix that improves API request cleanliness by excluding None values. The implementation is correct - the HTTP client's jsonable_encoder handles dictionaries properly, and the CreateDatasetRunItemRequest model already has built-in support for exclude_none. No breaking changes or side effects expected.
  • No files require special attention

Important Files Changed

Filename Overview
langfuse/_client/client.py Adds .dict(exclude_none=True) to prevent sending None values for datasetVersion in dataset run item requests. Change is safe and follows best practices for API request serialization.

Last reviewed commit: 826049b

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

@hassiebp hassiebp merged commit ba28dae into main Feb 19, 2026
7 of 12 checks passed
@hassiebp hassiebp deleted the fix-dataset-run-item-experiment-dataset-version branch February 19, 2026 10:57
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.

1 participant