Skip to content

fix: URL-encode full_name in Unity Catalog API path parameters#1393

Open
nanookclaw wants to merge 1 commit into
databricks:mainfrom
nanookclaw:fix/url-encode-full-name
Open

fix: URL-encode full_name in Unity Catalog API path parameters#1393
nanookclaw wants to merge 1 commit into
databricks:mainfrom
nanookclaw:fix/url-encode-full-name

Conversation

@nanookclaw
Copy link
Copy Markdown

@nanookclaw nanookclaw commented Apr 17, 2026

Problem

Unity Catalog allows table/schema/model names with special characters (e.g. %, #, ?). When calling methods like tables.get(full_name=db.schema.my_table_#$%), the SDK interpolates full_name directly into the URL path without encoding, causing NotFound errors.

Repro:

from databricks.sdk import WorkspaceClient
ws = WorkspaceClient()
ws.tables.get(db.schema.my_table_#$%)  # NotFound: Table 'db.schema.my_table_' does not exist

Solution

Applied the existing _escape_multi_segment_path_parameter() helper (already used in files.py) to all full_name path parameters in catalog.py. This covers:

  • TablesAPI — get, delete, exists, update
  • SchemasAPI — get, delete, update
  • RegisteredModelsAPI — get, delete, update, get_by_alias, etc.
  • ModelVersionsAPI — get, delete, update
  • TableConstraintsAPI — delete
  • GrantsAPI — get, get_effective, update (with securable_type/full_name)
  • ResourceQuotasAPI — get

The encoding uses urllib.parse.quote() which safely handles special characters while preserving dots and underscores in normal names like catalog.schema.table.

Fixes #1266

Testing

  • Syntax check passes (python3 -m py_compile)
  • Import verification passes
  • Commit is GPG-signed and DCO sign-off

CC @ghansen (issue reporter)

NO_CHANGELOG=true

@nanookclaw nanookclaw force-pushed the fix/url-encode-full-name branch from fc566c5 to b45254d Compare April 27, 2026 09:10
@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: 1393
  • Commit SHA: b45254db7e5489cb602c498fc8b787fdf5b10394

Checks will be approved automatically on success.

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.

[ISSUE] tables.get does not URL-encode table names with special characters

1 participant