<?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 Best practice for dbutils with CICD in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/best-practice-for-dbutils-with-cicd/m-p/166838#M55621</link>
    <description>&lt;P&gt;I have a job with the following base parameters. I use dbutils.widgets.get to access the parameter.&lt;/P&gt;&lt;P&gt;What is the best practice for developing with dbutils, especially when working locally in vs code or during CI? For example, IntelliSense and linting tools aren't aware of dbutils.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;tasks:&lt;BR /&gt;- task_key: test_table&lt;BR /&gt;notebook_task:&lt;BR /&gt;notebook_path: ../src/test_table_dab.ipynb&lt;BR /&gt;base_parameters:&lt;BR /&gt;unity_catalog: ${var.unity_catalog}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 30 Aug 2026 21:48:57 GMT</pubDate>
    <dc:creator>AdamIH123</dc:creator>
    <dc:date>2026-08-30T21:48:57Z</dc:date>
    <item>
      <title>Best practice for dbutils with CICD</title>
      <link>https://community.databricks.com/t5/data-engineering/best-practice-for-dbutils-with-cicd/m-p/166838#M55621</link>
      <description>&lt;P&gt;I have a job with the following base parameters. I use dbutils.widgets.get to access the parameter.&lt;/P&gt;&lt;P&gt;What is the best practice for developing with dbutils, especially when working locally in vs code or during CI? For example, IntelliSense and linting tools aren't aware of dbutils.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;tasks:&lt;BR /&gt;- task_key: test_table&lt;BR /&gt;notebook_task:&lt;BR /&gt;notebook_path: ../src/test_table_dab.ipynb&lt;BR /&gt;base_parameters:&lt;BR /&gt;unity_catalog: ${var.unity_catalog}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 30 Aug 2026 21:48:57 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/best-practice-for-dbutils-with-cicd/m-p/166838#M55621</guid>
      <dc:creator>AdamIH123</dc:creator>
      <dc:date>2026-08-30T21:48:57Z</dc:date>
    </item>
    <item>
      <title>Re: Best practice for dbutils with CICD</title>
      <link>https://community.databricks.com/t5/data-engineering/best-practice-for-dbutils-with-cicd/m-p/166853#M55622</link>
      <description>&lt;P&gt;Two separate things worth splitting apart here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For IntelliSense/linting in VS Code: the official Databricks extension has a command for exactly this. Command Palette -&amp;gt; "Databricks: Configure autocomplete for Databricks globals". It installs PySpark for your project and adds/updates a __builtins__.pyi stub file so spark and dbutils (including .widgets) resolve for autocomplete and linting without any import statements. It's a type stub only, not a live object, so it won't execute anything, it just stops your editor/linter from flagging dbutils as undefined.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For actually running the code locally or in CI: dbutils.widgets specifically is not supported through Databricks Connect. It's explicitly listed as unavailable, alongside credentials, library, and notebook-workflow, on the Databricks Connect limitations page. So there's no way to get a real dbutils.widgets.get() working locally full stop, that's a platform limitation, not something you're missing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The pattern that sidesteps it rather than fighting it: keep dbutils.widgets.get() calls only in the thin notebook that's your DAB task's entry point, and never inside anything you import.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Notebook entry point (glue only, not unit tested): unity_catalog = dbutils.widgets.get("unity_catalog"), then from mypackage.core import run_job, then run_job(unity_catalog).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;src/mypackage/core.py, a plain function: def run_job(unity_catalog: str) -&amp;gt; None: ... typed, lintable, unit-testable, no dbutils dependency at all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With that split, IntelliSense/mypy/pytest all work on everything except that one glue line, and CI just imports run_job and calls it with a test string, no dbutils and no Databricks Connect required. If you do need to literally exercise the notebook path locally, the usual fallback is a small stub object with a matching widgets.get(name) interface injected via a conftest.py fixture, but for most teams the separation above removes the need for that entirely.&lt;/P&gt;</description>
      <pubDate>Sun, 30 Aug 2026 23:42:14 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/best-practice-for-dbutils-with-cicd/m-p/166853#M55622</guid>
      <dc:creator>DoTA</dc:creator>
      <dc:date>2026-08-30T23:42:14Z</dc:date>
    </item>
  </channel>
</rss>

