@BriGuy Here I have small code snippet which we have used. Hope this works well with you
from databricks.sdk import WorkspaceClient
w = WorkspaceClient()
def find_path_by_object_id(target_id, base_path="/"):
items = w.workspace.list(path=base_path)
for item in items:
try:
status = w.workspace.get_status(item.path)
if str(status.object_id) == str(target_id):
return item.path
if item.object_type == "DIRECTORY":
found = find_path_by_object_id(target_id, item.path)
if found:
return found
except Exception:
continue
return None
target_object_id = "<yourObejctID>"
resolved_path = find_path_by_object_id(target_object_id)
print(f"Path for ID {target_object_id} is: {resolved_path}")
Databricks Solution Architect