Skip to content

fix(catalog): URL-encode entity_name slashes in entity tag paths - #1575

Open
jaideeppyne wants to merge 1 commit into
databricks:mainfrom
jaideeppyne:fix/entity-tag-encode-slash-1493
Open

jaideeppyne wants to merge 1 commit into
databricks:mainfrom
jaideeppyne:fix/entity-tag-encode-slash-1493

Conversation

@jaideeppyne

Copy link
Copy Markdown

Problem

Unity Catalog allows entity names that contain / (e.g. a column named `Inferences/Second`). The Entity Tag Assignments API treats entity_name as a single path segment, so / must be percent-encoded as %2F.

EntityTagAssignmentsAPI currently interpolates entity_name (and tag_key) into the path without encoding. A raw / splits the path, matches no route, and fails with NotFound: No API found ....

Solution

  • Add _escape_path_parameter() that uses urllib.parse.quote(param, safe="") so / becomes %2F (unlike _escape_multi_segment_path_parameter, which intentionally preserves / for Files API paths).
  • Apply it to entity_name and tag_key in EntityTagAssignmentsAPI (list / get / delete / update).

Testing

  • Unit tests for _escape_path_parameter (/ → %2F, FQN with slash, other reserved chars).
  • Unit tests asserting EntityTagAssignmentsAPI.list/get/delete call _api.do with %2F in the path.

Fixes #1493

NO_CHANGELOG=true

Unity Catalog entity names (e.g. column `Inferences/Second`) are a single
path segment on the Entity Tag Assignments API. Interpolating a raw `/`
splits the path and yields NotFound. Encode with quote(..., safe="") so
`/` becomes `%2F`.

Fixes databricks#1493

Signed-off-by: Jaideep Pyne <jaideeppyne1997@gmail.com>

NO_CHANGELOG=true
@github-actions

Copy link
Copy Markdown

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/sdk-py

Inputs:

  • PR number: 1575
  • Commit SHA: 07e14793bbf3900be14d89829d5ed82c209485c9

Checks will be approved automatically on success.

This branch has not been deployed

No deployments
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.

entity_tag_assignments.list does not URL-encode entity names containing "/" (e.g. column "Inferences/Second")

1 participant