<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: python databricks sdk get object path from id in Administration &amp; Architecture</title>
    <link>https://community.databricks.com/t5/administration-architecture/python-databricks-sdk-get-object-path-from-id/m-p/121468#M3461</link>
    <description>&lt;P&gt;I'd appreciate a snippet if you have one.&lt;/P&gt;</description>
    <pubDate>Wed, 11 Jun 2025 13:53:23 GMT</pubDate>
    <dc:creator>BriGuy</dc:creator>
    <dc:date>2025-06-11T13:53:23Z</dc:date>
    <item>
      <title>python databricks sdk get object path from id</title>
      <link>https://community.databricks.com/t5/administration-architecture/python-databricks-sdk-get-object-path-from-id/m-p/121459#M3459</link>
      <description>&lt;P&gt;when using the databricks SDK to get permissions of objects we get&amp;nbsp;&lt;/P&gt;&lt;P&gt;inherited_from_object=['/directories/1636517342231743']&lt;/P&gt;&lt;P&gt;from what I can see the workspace list and get_status methods only work with the actual path.&amp;nbsp; Is there a way to look up that directory path from the ID?&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jun 2025 11:58:14 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/python-databricks-sdk-get-object-path-from-id/m-p/121459#M3459</guid>
      <dc:creator>BriGuy</dc:creator>
      <dc:date>2025-06-11T11:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: python databricks sdk get object path from id</title>
      <link>https://community.databricks.com/t5/administration-architecture/python-databricks-sdk-get-object-path-from-id/m-p/121460#M3460</link>
      <description>&lt;P&gt;Did you try with&lt;SPAN&gt;&amp;nbsp;the &lt;/SPAN&gt;GET /api/2.0/workspace/get-status&lt;SPAN&gt; endpoint&lt;/SPAN&gt;&lt;BR /&gt;Solution 1:-&lt;BR /&gt;&lt;SPAN&gt;Brute Force with &lt;/SPAN&gt;workspace.list()&lt;SPAN&gt; and Recursion - This can be achieved using get_Stataus() method.&lt;BR /&gt;&lt;BR /&gt;Let me know if you require code snippet.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jun 2025 12:16:54 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/python-databricks-sdk-get-object-path-from-id/m-p/121460#M3460</guid>
      <dc:creator>CURIOUS_DE</dc:creator>
      <dc:date>2025-06-11T12:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: python databricks sdk get object path from id</title>
      <link>https://community.databricks.com/t5/administration-architecture/python-databricks-sdk-get-object-path-from-id/m-p/121468#M3461</link>
      <description>&lt;P&gt;I'd appreciate a snippet if you have one.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jun 2025 13:53:23 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/python-databricks-sdk-get-object-path-from-id/m-p/121468#M3461</guid>
      <dc:creator>BriGuy</dc:creator>
      <dc:date>2025-06-11T13:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: python databricks sdk get object path from id</title>
      <link>https://community.databricks.com/t5/administration-architecture/python-databricks-sdk-get-object-path-from-id/m-p/121659#M3467</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/93881"&gt;@BriGuy&lt;/a&gt;&amp;nbsp; Here I have small code snippet which we have used. Hope this works well with you&lt;/P&gt;&lt;LI-CODE lang="python"&gt;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 = "&amp;lt;yourObejctID&amp;gt;"
resolved_path = find_path_by_object_id(target_object_id)

print(f"Path for ID {target_object_id} is: {resolved_path}")&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 12 Jun 2025 19:27:24 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/python-databricks-sdk-get-object-path-from-id/m-p/121659#M3467</guid>
      <dc:creator>CURIOUS_DE</dc:creator>
      <dc:date>2025-06-12T19:27:24Z</dc:date>
    </item>
  </channel>
</rss>

