<?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 Using (python) import on azure databricks in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/using-python-import-on-azure-databricks/m-p/19269#M12904</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My team is currently working on azure databricks with a mid sized repo. When we wish to import pyspark functions and classes from other notebooks we currently use &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;%run &amp;lt;relpath&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;which is less than ideal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to replicate the functionality of &lt;A href="https://docs.databricks.com/_static/notebooks/files-in-repos.html" alt="https://docs.databricks.com/_static/notebooks/files-in-repos.html" target="_blank"&gt;this repo&lt;/A&gt;. However, when I clone it into the "repos" (see screenshot) section on my azure databricks instance, it will not work.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/1820iC811BB3291BD4AE4/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The location of the repo is not&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;/Workspace/Repos/&amp;lt;username&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;the best lock I can get on a location is an adb hyperlink&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;A href="https://adb-&amp;lt;workspace_id&amp;gt;.13.azuredatabricks.net/?o=&amp;lt;workspace_id&amp;gt;#folder/&amp;lt;repo_id&amp;gt;" target="test_blank"&gt;https://adb-&amp;lt;workspace_id&amp;gt;.13.azuredatabricks.net/?o=&amp;lt;workspace_id&amp;gt;#folder/&amp;lt;repo_id&amp;gt;&lt;/A&gt;;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;When I run sys.path(), I get the following output:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;/databricks/python_shell/scripts 
/local_disk0/spark-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/userFiles-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx 
/databricks/spark/python /databricks/spark/python/lib/py4j-0.10.9.1-src.zip 
/databricks/jars/spark--driver--driver-spark_3.2_2.12_deploy.jar 
/databricks/jars/spark--maven-trees--ml--10.x--graphframes--org.graphframes--graphframes_2.12--org.graphframes__graphframes_2.12__0.8.2-db1-spark3.2.jar 
/databricks/python_shell 
/usr/lib/python38.zip 
/usr/lib/python3.8 
/usr/lib/python3.8/lib-dynload 
/databricks/python/lib/python3.8/site-packages 
/usr/local/lib/python3.8/dist-packages 
/usr/lib/python3/dist-packages 
/databricks/.python_edge_libs 
/databricks/python/lib/python3.8/site-packages/IPython/extensions&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems that the second path is where my notebook is being run from, but it is not persistent and the directory is empty. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, my question is how can I use python's import functionality (as indicated in the linked example documentation) with my repo in adb?&lt;/P&gt;</description>
    <pubDate>Mon, 30 May 2022 04:27:51 GMT</pubDate>
    <dc:creator>sebg</dc:creator>
    <dc:date>2022-05-30T04:27:51Z</dc:date>
    <item>
      <title>Using (python) import on azure databricks</title>
      <link>https://community.databricks.com/t5/data-engineering/using-python-import-on-azure-databricks/m-p/19269#M12904</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My team is currently working on azure databricks with a mid sized repo. When we wish to import pyspark functions and classes from other notebooks we currently use &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;%run &amp;lt;relpath&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;which is less than ideal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to replicate the functionality of &lt;A href="https://docs.databricks.com/_static/notebooks/files-in-repos.html" alt="https://docs.databricks.com/_static/notebooks/files-in-repos.html" target="_blank"&gt;this repo&lt;/A&gt;. However, when I clone it into the "repos" (see screenshot) section on my azure databricks instance, it will not work.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/1820iC811BB3291BD4AE4/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The location of the repo is not&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;/Workspace/Repos/&amp;lt;username&amp;gt;/&amp;lt;repo_name&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;the best lock I can get on a location is an adb hyperlink&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;A href="https://adb-&amp;lt;workspace_id&amp;gt;.13.azuredatabricks.net/?o=&amp;lt;workspace_id&amp;gt;#folder/&amp;lt;repo_id&amp;gt;" target="test_blank"&gt;https://adb-&amp;lt;workspace_id&amp;gt;.13.azuredatabricks.net/?o=&amp;lt;workspace_id&amp;gt;#folder/&amp;lt;repo_id&amp;gt;&lt;/A&gt;;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;When I run sys.path(), I get the following output:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;/databricks/python_shell/scripts 
/local_disk0/spark-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/userFiles-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx 
/databricks/spark/python /databricks/spark/python/lib/py4j-0.10.9.1-src.zip 
/databricks/jars/spark--driver--driver-spark_3.2_2.12_deploy.jar 
/databricks/jars/spark--maven-trees--ml--10.x--graphframes--org.graphframes--graphframes_2.12--org.graphframes__graphframes_2.12__0.8.2-db1-spark3.2.jar 
/databricks/python_shell 
/usr/lib/python38.zip 
/usr/lib/python3.8 
/usr/lib/python3.8/lib-dynload 
/databricks/python/lib/python3.8/site-packages 
/usr/local/lib/python3.8/dist-packages 
/usr/lib/python3/dist-packages 
/databricks/.python_edge_libs 
/databricks/python/lib/python3.8/site-packages/IPython/extensions&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems that the second path is where my notebook is being run from, but it is not persistent and the directory is empty. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, my question is how can I use python's import functionality (as indicated in the linked example documentation) with my repo in adb?&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 04:27:51 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/using-python-import-on-azure-databricks/m-p/19269#M12904</guid>
      <dc:creator>sebg</dc:creator>
      <dc:date>2022-05-30T04:27:51Z</dc:date>
    </item>
  </channel>
</rss>

