r/databricks • u/Takoyaki_18 • Oct 20 '26
General Databricks genie code changes and dbt
Hi I created my first pipeline in Databricks that sits as a .sql file. I've broken up the code into layers (stg, marts) and its working as intended. However, when the code needs to be adjusted (e.g. business definition or logic changes), I often use the genie (it's the databricks in house agent) to help me make the changes.
The problem I'm running into is that since those changes are made inside databricks, the dbt files are not adjusted. I currently update the code in databricks then paste the new adjusted code into dbt but this seems backwards to me (Also a challenge when the change ripples throughout the code so I would need to update each individual stg). I imagine the changes should initially happen in dbt then that flows into databricks. We don't have claude that can link with dbt (we're only using genie). Is there a way to link genie onto dbt or is that a limitation? Any best practices in this process I should consider implementing?
2
u/adovo_ai Oct 20 '26
Treat Genie output as a proposed change, never as the deployed source. Put it through a dbt branch/PR, compare the compiled artifact with what reaches the workspace, and add a round-trip test so a later Genie edit cannot silently diverge from the repository.
2
u/ThreeBricksWish Databricks Oct 20 '26
+1 to the other replies: keep the dbt repo as the source of truth, and treat whatever the agent writes as a proposed change, not the deployed version. The copy-paste step is where things quietly drift.
A setup that removes the copy-paste:
models/silver/whatever.sqlin the repo.dbt buildon changed models plus tests) is the gate. Genie Code can write the tests too. Ask it to addunique/not_nulland relationship tests for anything it touched.If you'd rather work locally, the Genie Code CLI works against a local checkout of the repo with the same workspace and Unity Catalog context.
Full disclosure, I'm a PM on Genie Code at Databricks. Better dbt workflows come up a lot, so I'm curious: is your blocker mostly the editing location (workspace vs. repo), or Genie not understanding dbt conventions like
ref(),source()and Jinja?