Skip to content

EntityTagAssignments (list/get/update/delete) do not URL-encode EntityName/TagKey path params (e.g. "/" in column names) #1765

Description

@ozielDBX

Description

Unity Catalog allows column names that contain a forward slash / (for example a column named `Inferences/Second`, created with delta.columnMapping.mode='name'). The Entity Tag Assignments API takes the fully-qualified EntityName as a single path segment, so any / in the name must be percent-encoded (%2F).

The Go SDK builds the request path with fmt.Sprintf and interpolates EntityName (and TagKey) without URL-encoding. A raw / is therefore sent on the wire, splits the path into extra segments, matches no route, and the call fails with NotFound: No API found ... — before Unity Catalog ever resolves the entity.

The server side is correct: an equivalent request with the name percent-encoded (Inferences%2FSecond) returns 200 with the expected tag. Only the client-side path construction is at fault.

This surfaces to end users through the Databricks CLI (databricks entity-tag-assignments list columns <fqn>), which wraps this SDK — the CLI --debug output is tagged sdk=true.

Source (service/catalog/impl.go) — the EntityName/TagKey path parameters are interpolated raw, with no url.PathEscape(...):

// entityTagAssignmentsImpl.List
path := fmt.Sprintf("/api/2.1/unity-catalog/entity-tag-assignments/%v/%v/tags",
    request.EntityType, request.EntityName)

// Get / Update / Delete — EntityName AND TagKey both unescaped
path := fmt.Sprintf("/api/2.1/unity-catalog/entity-tag-assignments/%v/%v/tags/%v",
    request.EntityType, request.EntityName, request.TagKey)

This is the same root cause as the Python SDK issue databricks/databricks-sdk-py#1493 and databricks/databricks-sdk-py#1266 (tables.get not encoding %) — so the encoding gap appears systemic across UC path parameters and across SDK languages, not specific to one call.

Reproduction

Via the Databricks CLI (which uses this SDK) against a UC table with a column named Inferences/Second, tagged e.g. env=demo:

# Control column — works
$ databricks entity-tag-assignments list columns main.my_schema.my_table.inferences_per_second
[ { "tag_key": "env", "tag_value": "demo", ... } ]

# Raw "/" — fails
$ databricks entity-tag-assignments list columns main.my_schema.my_table.Inferences/Second
Error: No API found for 'GET /unity-catalog/entity-tag-assignments/columns/main.my_schema.my_table.Inferences/Second/tags'

# Pre-encoded "%2F" — works (proves server accepts the encoded form)
$ databricks entity-tag-assignments list columns main.my_schema.my_table.Inferences%2FSecond
[ { "tag_key": "env", "tag_value": "demo", ... } ]

Equivalent Go:

_, err := w.EntityTagAssignments.ListAll(ctx, catalog.ListEntityTagAssignmentsRequest{
    EntityType: "columns",
    EntityName: "main.my_schema.my_table.Inferences/Second", // raw "/" not encoded -> NotFound
})

Expected behavior

The SDK should percent-encode path parameters such as EntityName and TagKey (e.g. via url.PathEscape) so entity names containing URL-reserved characters (/, %, #, ?, space, …) resolve correctly. UC permits these names, so the SDK should be able to address them. A raw / should not produce an unroutable request.

Is it a regression?

Not that I'm aware of — these methods have never escaped the path parameters.

Debug Logs

CLI --debug on the failing call (workspace/table names redacted):

Debug: GET /api/2.1/unity-catalog/entity-tag-assignments/columns/main.my_schema.my_table.Inferences/Second/tags
Debug: non-retriable error: No API found for 'GET /unity-catalog/entity-tag-assignments/columns/main.my_schema.my_table.Inferences/Second/tags' sdk=true
Error: No API found for 'GET /unity-catalog/entity-tag-assignments/columns/main.my_schema.my_table.Inferences/Second/tags'

Note the logged request line contains a raw / in the column name — it should be %2F.

Other Information

  • OS: macOS 26.5.2 (arm64)
  • Version: Databricks CLI v0.296.0 (wraps databricks-sdk-go); reproduced against an AWS Unity Catalog workspace

Additional context

Confirmed via curl that the server accepts the encoded form (client-side bug only):

Path segment for the column HTTP Result
…inferences_per_second (control column) 200 returns the tag
…Inferences/Second (raw /) 404 No API found (this bug)
…Inferences%2FSecond (percent-encoded) 200 returns the tag ✅
…Inferences%252FSecond (double-encoded) 404 Column 'Inferences%2FSecond' does not exist

Related: databricks/databricks-sdk-py#1493 (same bug, entity_tag_assignments.list, Python SDK), databricks/databricks-sdk-py#1266 (tables.get, %).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions