<?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 Import functions in databricks asset bundles using source: WORKSPACE in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/import-functions-in-databricks-asset-bundles-using-source/m-p/143080#M52089</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We are using Databricks asset bundles, and we create functions which we import in notebooks, for instance:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from utils import helpers&lt;/LI-CODE&gt;&lt;P&gt;where utils is just a folder in our root. When running this with source: WORKSPACE, it will fail to resolve the import. while when we have source: GIT, it works.&lt;/P&gt;&lt;P&gt;Is there any best practice how we should deal with this? I know that we could build a wheel file but, we have multiple of these folders and using UV I am not sure if it is really possible to include all these folders where we import functions from.&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;</description>
    <pubDate>Tue, 06 Jan 2026 08:40:49 GMT</pubDate>
    <dc:creator>Maxrb</dc:creator>
    <dc:date>2026-01-06T08:40:49Z</dc:date>
    <item>
      <title>Import functions in databricks asset bundles using source: WORKSPACE</title>
      <link>https://community.databricks.com/t5/data-engineering/import-functions-in-databricks-asset-bundles-using-source/m-p/143080#M52089</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We are using Databricks asset bundles, and we create functions which we import in notebooks, for instance:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from utils import helpers&lt;/LI-CODE&gt;&lt;P&gt;where utils is just a folder in our root. When running this with source: WORKSPACE, it will fail to resolve the import. while when we have source: GIT, it works.&lt;/P&gt;&lt;P&gt;Is there any best practice how we should deal with this? I know that we could build a wheel file but, we have multiple of these folders and using UV I am not sure if it is really possible to include all these folders where we import functions from.&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jan 2026 08:40:49 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/import-functions-in-databricks-asset-bundles-using-source/m-p/143080#M52089</guid>
      <dc:creator>Maxrb</dc:creator>
      <dc:date>2026-01-06T08:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: Import functions in databricks asset bundles using source: WORKSPACE</title>
      <link>https://community.databricks.com/t5/data-engineering/import-functions-in-databricks-asset-bundles-using-source/m-p/143106#M52095</link>
      <description>&lt;P&gt;In Git folders, the repo root is auto-added to the Python path, so imports like from utils import helpers work, while in workspace folders, only the notebook’s directory is on the path, which is why it breaks.&lt;/P&gt;
&lt;P&gt;The quick fix is a tiny bootstrap that appends your shared folder to sys.path as follows:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;import os, sys
# Example: add the project root (adjust as needed)
sys.path.append(os.path.abspath("/Workspace/Users/&amp;lt;your_user&amp;gt;/my_project_root"))
from utils import helpers&lt;/LI-CODE&gt;
&lt;P&gt;and the production‑grade fix is to package shared code as a Python wheel (built with uv) and attach it in your bundle’s task libraries; store wheels in Workspace Files or Unity Catalog volumes; and you can either put multiple subpackages into one wheel or attach multiple wheels per task depending on how you prefer to split the code.&lt;/P&gt;
&lt;P&gt;Ref Doc for this:&lt;BR /&gt;1 -&amp;nbsp;&lt;A href="https://docs.databricks.com/aws/en/dev-tools/bundles/library-dependencies" target="_blank"&gt;https://docs.databricks.com/aws/en/dev-tools/bundles/library-dependencies&lt;/A&gt;&lt;BR /&gt;2 -&amp;nbsp;&lt;A href="https://docs.databricks.com/aws/en/dev-tools/bundles/python-wheel" target="_blank"&gt;https://docs.databricks.com/aws/en/dev-tools/bundles/python-wheel&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jan 2026 15:35:23 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/import-functions-in-databricks-asset-bundles-using-source/m-p/143106#M52095</guid>
      <dc:creator>iyashk-DB</dc:creator>
      <dc:date>2026-01-06T15:35:23Z</dc:date>
    </item>
  </channel>
</rss>

