[OPIK-5614] [SDK] fix: use actual project name from backend when retrieving datasets#6050
Merged
alexkuzmik merged 5 commits intomainfrom Apr 2, 2026
Conversation
…ieving datasets When get_dataset or get_evaluation_suite was called without project_name, the SDK defaulted to "Default Project" and stored it on the Dataset object. The backend found the dataset via workspace-wide fallback, but downstream calls (stream items, etc.) used the wrong project name, returning empty results. Now the SDK resolves the actual project name from the backend response's project_id, matching the pattern already used by experiments. Adds e2e regression tests for both get_dataset and get_evaluation_suite. Implements OPIK-5614: suite found but items not picked up without project name Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Contributor
Contributor
Contributor
Contributor
The new _get_project_name_by_id method needs project_id to be explicitly None on mock objects to short-circuit, otherwise Mock returns a nested Mock that causes infinite recursion. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The fallback behavior is a backend responsibility (tracked in OPIK-5619), not something the SDK should assert in e2e tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move dataset construction + project_id resolution logic from opik_client into a Dataset.from_public() classmethod. Both get_dataset and get_evaluation_suite now use it, removing duplication. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
yaricom
approved these changes
Apr 2, 2026
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.
Details
When
get_datasetorget_evaluation_suitewas called withoutproject_name, the SDK defaulted to"Default Project"and stored it on theDatasetobject. The backend found the dataset via workspace-wide fallback, but all downstream API calls (streaming items, inserting items, etc.) used the wrong project name — causing items to not be resolved correctly.Now the SDK resolves the actual project name from the backend response's
project_id, matching the pattern already used by experiments (which passexperiment_public.project_namedirectly).Change checklist
Issues
AI-WATERMARK
AI-WATERMARK: yes
Testing
Ran the two new e2e regression tests against
test.dev.comet.com:Both passed (6.39s). Backend deprecation warning confirmed the workspace-wide fallback was triggered, and items were returned correctly after the fix.
Scenarios validated:
project_nameproject_nameon the returned object matches the actual projectDocumentation
N/A — no new configuration or public API changes.