<?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: Bug in Asset Bundle Sync in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/bug-in-asset-bundle-sync/m-p/137738#M50799</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/196681"&gt;@max_eg&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What you’re seeing is expected with Asset Bundles.&lt;/STRONG&gt;&lt;BR /&gt;databricks bundle deploy computes what changed &lt;STRONG&gt;locally&lt;/STRONG&gt; and only uploads those files. If you edited nb1.py &lt;STRONG&gt;in the workspace&lt;/STRONG&gt; (not locally), the deploy won’t “see” a local delta for that file, so it leaves the remote copy as-is. That’s why your local tweak to utils.py synced, but your debug edits in the remote nb1.py persisted until you made a dummy local change.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Recommended practices / options&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Treat the workspace copy as read-only.&lt;/STRONG&gt;&lt;BR /&gt;Do your debugging locally (or in a separate scratch area in the workspace, &lt;EM&gt;not&lt;/EM&gt; under the bundle’s target path), then deploy. With bundles, your &lt;STRONG&gt;local repo is the source of truth&lt;/STRONG&gt;.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Clean the target path before deploy (hard reset).&lt;/STRONG&gt;&lt;BR /&gt;If you need the remote to exactly mirror local, delete the deployed files and redeploy:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;LI-CODE lang="python"&gt;# find the bundle’s workspace path from your bundle config (workspace.root_path) 
#bash
databricks workspace rm -r /Workspace/…/your-bundle-path # ‌‌ deletes files under that path databricks bundle deploy&lt;/LI-CODE&gt;&lt;P&gt;This removes any “drift” introduced by editing in the UI.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Package shared code as a wheel instead of loose .py files.&lt;/STRONG&gt;&lt;BR /&gt;Put utils.py into a small package (e.g., setup.cfg/pyproject.toml) and reference it in the job libraries. That way your job uses a versioned artifact and you avoid partial sync quirks.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;If you must edit online:&lt;/STRONG&gt;&lt;BR /&gt;Copy the notebook to a &lt;STRONG&gt;scratch folder&lt;/STRONG&gt; (outside the bundle path), debug there, then bring the fix back to local and redeploy. Avoid editing the deployed bundle path directly.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Your workaround (adding a local “hello world” so the file re-uploads) works because it nudges the local fingerprint, but the approaches above are cleaner and repeatable for CI/CD.&lt;/P&gt;&lt;P&gt;Hope that helps!&lt;/P&gt;</description>
    <pubDate>Wed, 05 Nov 2025 11:00:50 GMT</pubDate>
    <dc:creator>bianca_unifeye</dc:creator>
    <dc:date>2025-11-05T11:00:50Z</dc:date>
    <item>
      <title>Bug in Asset Bundle Sync</title>
      <link>https://community.databricks.com/t5/data-engineering/bug-in-asset-bundle-sync/m-p/137731#M50796</link>
      <description>&lt;P&gt;I think I found a bug in the way asset bundles sync/ deploy, or at least I have a question if I understood it correctly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Setup:&lt;/P&gt;&lt;P&gt;I have an asset bundle, consisting of a notebook nb1.py and a utils module utils.py.&lt;/P&gt;&lt;P&gt;nb1.py imports functions from utils.py.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I develop locally, and push the bundle via dabaricks cli tool with "databricks bundle deploy" and "databricks bundle run".&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Workflow:&lt;/P&gt;&lt;P&gt;1. I run the bundle&lt;/P&gt;&lt;P&gt;2. the job fails due to some reason, and I do some debugging in the notebook directly in the bundle folder in Databricks.&lt;/P&gt;&lt;P&gt;3. I find the error, which was located in the utils.py file, and adjust the utils.py file locally. At this point I have edited the utils.py file locally, and the nb1.py file in DBX.&lt;/P&gt;&lt;P&gt;4. I run "databricks bundle deploy" and "datarbicks bundle run"&lt;/P&gt;&lt;P&gt;5. I observed that my local changes in utils.py were successfully synced with the file in the online bundle, but the changes I did online in nb1.py were not overwritten (as I expected) by my unchanged local nb1.py file to remove the code I wrote for debugging.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;6. My workaround: Make a dummy change locally in nb1.py, by adding a line "print('hello world')", then deploy again, then the online nb1.py is identical to the local one again.&lt;/P&gt;&lt;P&gt;My question:&lt;/P&gt;&lt;P&gt;I guess this is due to the way the sync works - only looking for edits locally, and if any was found, the file is synced. Is this correct?&amp;nbsp;&lt;BR /&gt;Is there a better solution to my problem, as for example a cleaning of all files online before I deploy?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 05 Nov 2025 10:06:46 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/bug-in-asset-bundle-sync/m-p/137731#M50796</guid>
      <dc:creator>max_eg</dc:creator>
      <dc:date>2025-11-05T10:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: Bug in Asset Bundle Sync</title>
      <link>https://community.databricks.com/t5/data-engineering/bug-in-asset-bundle-sync/m-p/137738#M50799</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/196681"&gt;@max_eg&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What you’re seeing is expected with Asset Bundles.&lt;/STRONG&gt;&lt;BR /&gt;databricks bundle deploy computes what changed &lt;STRONG&gt;locally&lt;/STRONG&gt; and only uploads those files. If you edited nb1.py &lt;STRONG&gt;in the workspace&lt;/STRONG&gt; (not locally), the deploy won’t “see” a local delta for that file, so it leaves the remote copy as-is. That’s why your local tweak to utils.py synced, but your debug edits in the remote nb1.py persisted until you made a dummy local change.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Recommended practices / options&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Treat the workspace copy as read-only.&lt;/STRONG&gt;&lt;BR /&gt;Do your debugging locally (or in a separate scratch area in the workspace, &lt;EM&gt;not&lt;/EM&gt; under the bundle’s target path), then deploy. With bundles, your &lt;STRONG&gt;local repo is the source of truth&lt;/STRONG&gt;.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Clean the target path before deploy (hard reset).&lt;/STRONG&gt;&lt;BR /&gt;If you need the remote to exactly mirror local, delete the deployed files and redeploy:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;LI-CODE lang="python"&gt;# find the bundle’s workspace path from your bundle config (workspace.root_path) 
#bash
databricks workspace rm -r /Workspace/…/your-bundle-path # ‌‌ deletes files under that path databricks bundle deploy&lt;/LI-CODE&gt;&lt;P&gt;This removes any “drift” introduced by editing in the UI.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Package shared code as a wheel instead of loose .py files.&lt;/STRONG&gt;&lt;BR /&gt;Put utils.py into a small package (e.g., setup.cfg/pyproject.toml) and reference it in the job libraries. That way your job uses a versioned artifact and you avoid partial sync quirks.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;If you must edit online:&lt;/STRONG&gt;&lt;BR /&gt;Copy the notebook to a &lt;STRONG&gt;scratch folder&lt;/STRONG&gt; (outside the bundle path), debug there, then bring the fix back to local and redeploy. Avoid editing the deployed bundle path directly.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Your workaround (adding a local “hello world” so the file re-uploads) works because it nudges the local fingerprint, but the approaches above are cleaner and repeatable for CI/CD.&lt;/P&gt;&lt;P&gt;Hope that helps!&lt;/P&gt;</description>
      <pubDate>Wed, 05 Nov 2025 11:00:50 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/bug-in-asset-bundle-sync/m-p/137738#M50799</guid>
      <dc:creator>bianca_unifeye</dc:creator>
      <dc:date>2025-11-05T11:00:50Z</dc:date>
    </item>
  </channel>
</rss>

