Skip to content

Allow '/' as a namespace separator in dataset names#2032

Draft
dmontagu wants to merge 1 commit into
mainfrom
dmontagu/allow-namespaced-dataset-names
Draft

Allow '/' as a namespace separator in dataset names#2032
dmontagu wants to merge 1 commit into
mainfrom
dmontagu/allow-namespaced-dataset-names

Conversation

@dmontagu

@dmontagu dmontagu commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

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 DatasetName Pydantic 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_name now accepts /-separated names (+ tests for valid / names and rejected leading/trailing/double slashes).
  • ⚠️ Follow-up needed for full hosted round-trip: the client interpolates names directly into URL paths (/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 + the ui_api by-name/{name:path} route and regenerates the OpenAPI spec.

Review in cubic

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.
@dmontagu dmontagu self-assigned this Jun 18, 2026
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