<?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: Unittesting databricks.sdk.runtime in Get Started Discussions</title>
    <link>https://community.databricks.com/t5/get-started-discussions/unittesting-databricks-sdk-runtime/m-p/60290#M6539</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/99680"&gt;@samarth_solanki&lt;/a&gt;&amp;nbsp;, I Hope you are doing well!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on the information you have shared, it seems like you're trying to import dbutils from databricks.sdk.runtime, but you're encountering an error that says "databricks-sdk has no attribute runtime".&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This issue might be due to the incorrect import statement or the version of the Databricks SDK you're using.&amp;nbsp; To use dbutils with the Databricks SDK for Python is to call it from the WorkspaceClient. Kindly refer to this as a example:&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;from databricks.sdk import WorkspaceClient
w = WorkspaceClient()
d = w.dbutils.fs.ls('/')
for f in d:
    print(f.path)&lt;/LI-CODE&gt;
&lt;P&gt;If you still face the issue then I would suggest checking the latest version of the Databricks SDK you are using and you can upgrade to the latest version using the below command:&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;%pip install databricks-sdk --upgrade&lt;/LI-CODE&gt;
&lt;P&gt;Please refer this document for the more details:&amp;nbsp;&lt;A href="https://docs.databricks.com/ja/dev-tools/sdk-python.html#use-databricks-utilities" target="_blank"&gt;https://docs.databricks.com/ja/dev-tools/sdk-python.html#use-databricks-utilities&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Please let me know if this helps and leave a like if this information is useful, followups are appreciated.&lt;BR /&gt;Kudos&lt;BR /&gt;Ayushi&lt;/P&gt;</description>
    <pubDate>Thu, 15 Feb 2024 05:37:31 GMT</pubDate>
    <dc:creator>Ayushi_Suthar</dc:creator>
    <dc:date>2024-02-15T05:37:31Z</dc:date>
    <item>
      <title>Unittesting databricks.sdk.runtime</title>
      <link>https://community.databricks.com/t5/get-started-discussions/unittesting-databricks-sdk-runtime/m-p/60196#M6537</link>
      <description>&lt;P&gt;How to mock a code that uses dbutils from&lt;BR /&gt;"from databricks.sdk.runtime import dbutils"&lt;BR /&gt;it shows databricks-sdk has no attribute runtime&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2024 12:19:41 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/unittesting-databricks-sdk-runtime/m-p/60196#M6537</guid>
      <dc:creator>samarth_solanki</dc:creator>
      <dc:date>2024-02-14T12:19:41Z</dc:date>
    </item>
    <item>
      <title>Re: Unittesting databricks.sdk.runtime</title>
      <link>https://community.databricks.com/t5/get-started-discussions/unittesting-databricks-sdk-runtime/m-p/60290#M6539</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/99680"&gt;@samarth_solanki&lt;/a&gt;&amp;nbsp;, I Hope you are doing well!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on the information you have shared, it seems like you're trying to import dbutils from databricks.sdk.runtime, but you're encountering an error that says "databricks-sdk has no attribute runtime".&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This issue might be due to the incorrect import statement or the version of the Databricks SDK you're using.&amp;nbsp; To use dbutils with the Databricks SDK for Python is to call it from the WorkspaceClient. Kindly refer to this as a example:&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;from databricks.sdk import WorkspaceClient
w = WorkspaceClient()
d = w.dbutils.fs.ls('/')
for f in d:
    print(f.path)&lt;/LI-CODE&gt;
&lt;P&gt;If you still face the issue then I would suggest checking the latest version of the Databricks SDK you are using and you can upgrade to the latest version using the below command:&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;%pip install databricks-sdk --upgrade&lt;/LI-CODE&gt;
&lt;P&gt;Please refer this document for the more details:&amp;nbsp;&lt;A href="https://docs.databricks.com/ja/dev-tools/sdk-python.html#use-databricks-utilities" target="_blank"&gt;https://docs.databricks.com/ja/dev-tools/sdk-python.html#use-databricks-utilities&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Please let me know if this helps and leave a like if this information is useful, followups are appreciated.&lt;BR /&gt;Kudos&lt;BR /&gt;Ayushi&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2024 05:37:31 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/unittesting-databricks-sdk-runtime/m-p/60290#M6539</guid>
      <dc:creator>Ayushi_Suthar</dc:creator>
      <dc:date>2024-02-15T05:37:31Z</dc:date>
    </item>
  </channel>
</rss>

