Allow '/' as a namespace separator in dataset names#2032
Draft
dmontagu wants to merge 1 commit into
Draft
Conversation
Relax _DATASET_NAME_RE (and its error message) in the experimental dataset API client to accept '/' between well-formed segments, e.g. 'team-a/support-routing'. This mirrors the platform's DatasetName Pydantic type and lets datasets be grouped by prefix in the Logfire UI.
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.
What
Relax
_DATASET_NAME_RE(and its error message) in the experimental dataset API client so dataset names may contain/as a namespace separator between well-formed segments, e.g.team-a/support-routing. Leading, trailing, and repeated slashes remain rejected.This mirrors the platform's
DatasetNamePydantic type and unlocks grouping datasets by prefix in the Logfire UI.Why
Driven by user feedback that large numbers of datasets/experiments are hard to organize. The platform side adds a "group by prefix" view + pin/favorites for the datasets directory; for the SDK's hosted-dataset client to accept namespaced names, this regex needs to match the platform's relaxed validation.
Scope / status (draft)
This is the SDK half of a cross-repo change and is intentionally a draft until the platform side lands and we agree on the path-encoding approach below.
_validate_dataset_namenow accepts/-separated names (+ tests for valid/names and rejected leading/trailing/double slashes)./v1/datasets/{id_or_name}/). For path-based by-name operations on a/-named hosted dataset to work, the name must be URL-encoded here and the platform's/v1/datasets/{id_or_name}route must accept an encoded slash (:path). Creating by name (POST with the name in the JSON body) already works. Local / code-defined (pydantic-evals) datasets don't go through this client and already support/.Companion platform change relaxes
DatasetName+ theui_apiby-name/{name:path}route and regenerates the OpenAPI spec.