<?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 Genie spaces with DABs - how do you deal with the table ordering? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/genie-spaces-with-dabs-how-do-you-deal-with-the-table-ordering/m-p/172858#M56683</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I'm about to start managing Genie spaces as code with Asset Bundles and wanted&lt;BR /&gt;to ask before I build it.&lt;/P&gt;&lt;P&gt;From what I'm reading, the genie_spaces resource needs the tables in its&lt;BR /&gt;data_sources to already exist when you deploy. That's fine for an environment&lt;BR /&gt;that's already running, but it seems to break the first deploy to a new target,&lt;BR /&gt;where the same bundle is creating the schema and tables and then declaring the&lt;BR /&gt;Genie space on top of them.&lt;/P&gt;&lt;P&gt;I could split it into two deploys, but then I lose the single command deploy&lt;BR /&gt;that's half the point of using bundles.&lt;/P&gt;&lt;P&gt;For anyone already doing this:&lt;/P&gt;&lt;P&gt;Are you keeping the Genie space in the same bundle as the tables it reads, or&lt;BR /&gt;did you end up separating them?&lt;/P&gt;&lt;P&gt;And one I haven't found an answer to anywhere: on a redeploy, what happens to&lt;BR /&gt;the instructions and example queries people add to the space through the UI?&lt;BR /&gt;Does the bundle overwrite them?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Mon, 12 Oct 2026 21:03:50 GMT</pubDate>
    <dc:creator>juanlozadab</dc:creator>
    <dc:date>2026-10-12T21:03:50Z</dc:date>
    <item>
      <title>Genie spaces with DABs - how do you deal with the table ordering?</title>
      <link>https://community.databricks.com/t5/data-engineering/genie-spaces-with-dabs-how-do-you-deal-with-the-table-ordering/m-p/172858#M56683</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I'm about to start managing Genie spaces as code with Asset Bundles and wanted&lt;BR /&gt;to ask before I build it.&lt;/P&gt;&lt;P&gt;From what I'm reading, the genie_spaces resource needs the tables in its&lt;BR /&gt;data_sources to already exist when you deploy. That's fine for an environment&lt;BR /&gt;that's already running, but it seems to break the first deploy to a new target,&lt;BR /&gt;where the same bundle is creating the schema and tables and then declaring the&lt;BR /&gt;Genie space on top of them.&lt;/P&gt;&lt;P&gt;I could split it into two deploys, but then I lose the single command deploy&lt;BR /&gt;that's half the point of using bundles.&lt;/P&gt;&lt;P&gt;For anyone already doing this:&lt;/P&gt;&lt;P&gt;Are you keeping the Genie space in the same bundle as the tables it reads, or&lt;BR /&gt;did you end up separating them?&lt;/P&gt;&lt;P&gt;And one I haven't found an answer to anywhere: on a redeploy, what happens to&lt;BR /&gt;the instructions and example queries people add to the space through the UI?&lt;BR /&gt;Does the bundle overwrite them?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2026 21:03:50 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/genie-spaces-with-dabs-how-do-you-deal-with-the-table-ordering/m-p/172858#M56683</guid>
      <dc:creator>juanlozadab</dc:creator>
      <dc:date>2026-10-12T21:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: Genie spaces with DABs - how do you deal with the table ordering?</title>
      <link>https://community.databricks.com/t5/data-engineering/genie-spaces-with-dabs-how-do-you-deal-with-the-table-ordering/m-p/172890#M56685</link>
      <description>&lt;P&gt;Managing Databricks Genie spaces via Asset Bundles (DABs) introduces a few specific state and dependency challenges, especially around initial provisioning and UI collaboration. Most teams end up separating the Genie space from the underlying data layer. Because the genie_spaces resource validates its data_sources against Unity Catalog at deployment time, a single-bundle deploy will fail on a brand-new target environment where the tables don't exist yet. Keeping data pipeline jobs/tables in a primary data bundle and provisioning the Genie space in a secondary, downstream bundle ensures that all referenced schemas, views, and tables are fully established before the Genie space is declared.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2026 05:59:27 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/genie-spaces-with-dabs-how-do-you-deal-with-the-table-ordering/m-p/172890#M56685</guid>
      <dc:creator>maggie33west</dc:creator>
      <dc:date>2026-10-13T05:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: Genie spaces with DABs - how do you deal with the table ordering?</title>
      <link>https://community.databricks.com/t5/data-engineering/genie-spaces-with-dabs-how-do-you-deal-with-the-table-ordering/m-p/172948#M56694</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/252334"&gt;@juanlozadab&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;To answer your questions separately:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Q1: &lt;/STRONG&gt;&lt;STRONG&gt;same bundle or separate? Answer in short: separate&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;Deploying schema + pipeline + genie_spaces in one bundle fails on a fresh target.&lt;/STRONG&gt; A pipeline or job resource only gets defined at deploy time; it doesn't run, so no tables exist yet when the Genie space is created.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Splitting into two bundles is a valid workaround.&lt;/STRONG&gt; It's not the only answer anymore, though. There is a new job_run resource (CLI ≥ 1.7.0, direct engine only). It triggers a job run as part of bundle deploy, and "downstream objects that take a deployment on the run completing will only deploy once it has successfully run." That keeps everything in one bundle: schema → job that builds the tables → job_run → genie_spaces.&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Couple of Prerequisites for the deployment&lt;/STRONG&gt;
&lt;UL&gt;
&lt;LI&gt;genie_spaces needs the direct deployment engine (bundle: engine: direct) and CLI ≥ 1.3.0.&lt;/LI&gt;
&lt;LI&gt;The identity that deploys must be able to read every table the space uses.&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;Q2: are UI edits overwritten on redeploy?&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The bundle is the source of truth. The space definition (serialized_space / file_path → *.geniespace.json) includes the instructions and sample/example SQL, so a redeploy puts the bundle's version back.&lt;/LI&gt;
&lt;LI&gt;The supported workflow is to pull UI edits back into the bundle first:
&lt;UL&gt;
&lt;LI&gt;databricks bundle generate genie-space --resource &amp;lt;key&amp;gt; --force for a one-off sync, or --watch to keep it in sync during development;&lt;/LI&gt;
&lt;LI&gt;commit the result;&lt;/LI&gt;
&lt;LI&gt;then bundle deploy --target prod.&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;Recommended practice: edit in a dev space, sync, commit and promote. Treat prod as read-only in the UI.&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Tue, 13 Oct 2026 11:57:41 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/genie-spaces-with-dabs-how-do-you-deal-with-the-table-ordering/m-p/172948#M56694</guid>
      <dc:creator>Valeria_Koz_DBX</dc:creator>
      <dc:date>2026-10-13T11:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: Genie spaces with DABs - how do you deal with the table ordering?</title>
      <link>https://community.databricks.com/t5/data-engineering/genie-spaces-with-dabs-how-do-you-deal-with-the-table-ordering/m-p/173077#M56697</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Short answer:&lt;/STRONG&gt; you can keep everything in one bundle and one databricks bundle deploy. Add a job_runs resource that runs the job that builds the tables, and reference that run from the Genie agent so the CLI creates the agent last. On a redeploy the bundle &lt;STRONG&gt;does&lt;/STRONG&gt; overwrite instructions and example queries added in the UI, so pull UI edits back with databricks bundle generate genie-space --resource &amp;lt;key&amp;gt; --force before you deploy [1][2].&lt;/P&gt;&lt;H2&gt;1. Same bundle or separate?&lt;/H2&gt;&lt;P&gt;The Genie agent create call validates the tables in data_sources, so a fresh target fails if the tables don't exist yet. I reproduced it on CLI 1.20.0:&lt;/P&gt;&lt;PRE&gt;Error: cannot create resources.genie_spaces.probe_space: ... Table 'workspace.mvp_probe.not_created_yet' does not exist. (403 PERMISSION_DENIED)&lt;/PRE&gt;&lt;P&gt;This shape fixed it in a single deploy. genie_spaces and job_runs both need the direct deployment engine, which is the only engine in CLI 1.20.0 [1][3]:&lt;/P&gt;&lt;PRE&gt;bundle:
  name: sales_genie
  engine: direct

resources:
  pipelines:
    sales_pipeline:
      name: sales_pipeline
      serverless: true
      catalog: workspace
      schema: sales
      libraries:
        - file:
            path: ./src/sales.sql

  jobs:
    build_tables:
      name: build_tables
      tasks:
        - task_key: refresh
          pipeline_task:
            pipeline_id: ${resources.pipelines.sales_pipeline.id}

  job_runs:
    seed:
      job_id: ${resources.jobs.build_tables.id}

  genie_spaces:
    sales_agent:
      title: Sales agent
      description: 'Built after run ${resources.job_runs.seed.run_id}'
      warehouse_id: &amp;lt;warehouse-id&amp;gt;
      file_path: ./src/sales_agent.geniespace.json&lt;/PRE&gt;&lt;P&gt;What happened on the first deploy:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;The pipeline and job were created.&lt;/LI&gt;&lt;LI&gt;The job_runs resource started the job, and the CLI printed Output from job_runs.seed: ... SUCCESS once the run finished.&lt;/LI&gt;&lt;LI&gt;Only then did it print Created genie_spaces.&amp;lt;key&amp;gt;, because the ${resources.job_runs.seed.run_id} reference makes the agent depend on the run.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;The run is recorded in bundle state, so my next deploy didn't re-run it. If you want it to re-run on every deploy, job_runs supports lifecycle.triggers (on_bundle_deploy: true) [1].&lt;/P&gt;&lt;P&gt;I'd still split into two bundles if the table build is slow (the deploy blocks until the run ends) or if another team owns the tables.&lt;/P&gt;&lt;H2&gt;2. What happens to UI edits on redeploy?&lt;/H2&gt;&lt;P&gt;They get overwritten. I added a text instruction outside the bundle, which is what a UI edit does. databricks bundle plan then showed update genie_spaces.sales_agent, and after deploy the instruction was gone.&lt;/P&gt;&lt;P&gt;To keep UI work:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Store the definition in a file (file_path: ./src/&amp;lt;name&amp;gt;.geniespace.json). The --resource sync needs this. With an inline serialized_space the CLI fails with genie space resource "..." has no file path defined.&lt;/LI&gt;&lt;LI&gt;Export an existing agent once:&lt;/LI&gt;&lt;/OL&gt;&lt;PRE&gt;databricks bundle generate genie-space --existing-id &amp;lt;space-id&amp;gt; --key sales_agent&lt;/PRE&gt;&lt;OL&gt;&lt;LI&gt;Before each deploy, pull UI changes, review the diff and commit [2]:&lt;/LI&gt;&lt;/OL&gt;&lt;PRE&gt;databricks bundle generate genie-space --resource sales_agent --force&lt;/PRE&gt;&lt;OL&gt;&lt;LI&gt;While people are actively iterating in the UI, --watch --force keeps polling for changes [2].&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;After a pull, bundle plan can still show an update because the JSON key order differs. The content is the same.&lt;/P&gt;&lt;H2&gt;What I'd do&lt;/H2&gt;&lt;P&gt;Keep the Genie agent in the same bundle as its pipeline for dev and test targets, with the job_runs seed, and treat the .geniespace.json file in Git as the source of truth. Let people edit in the dev agent, sync with bundle generate genie-space --resource ... --force, and promote to prod only through bundle deploy.&lt;/P&gt;&lt;H2&gt;References&lt;/H2&gt;&lt;P&gt;[1] Declarative Automation Bundles resources | Databricks on AWS — &lt;A href="https://docs.databricks.com/aws/en/dev-tools/bundles/resources" target="_blank" rel="noopener"&gt;docs.databricks.com/aws/dev-tools/bundles/resources&lt;/A&gt;&lt;BR /&gt;[2] bundle command group | Databricks on AWS — &lt;A href="https://docs.databricks.com/aws/en/dev-tools/cli/bundle-commands" target="_blank" rel="noopener"&gt;docs.databricks.com/aws/dev-tools/cli/bundle-commands&lt;/A&gt;&lt;BR /&gt;[3] Migrate to the direct deployment engine | Databricks on AWS — &lt;A href="https://docs.databricks.com/aws/en/dev-tools/bundles/direct" target="_blank" rel="noopener"&gt;docs.databricks.com/aws/dev-tools/bundles/direct&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2026 21:47:21 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/genie-spaces-with-dabs-how-do-you-deal-with-the-table-ordering/m-p/173077#M56697</guid>
      <dc:creator>VladTamas</dc:creator>
      <dc:date>2026-10-13T21:47:21Z</dc:date>
    </item>
  </channel>
</rss>

