<?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: If statement in DAB YAML file support in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/if-statement-in-dab-yaml-file-support/m-p/165790#M55489</link>
    <description>&lt;P&gt;Quan,&lt;/P&gt;&lt;P&gt;You can follow below&lt;/P&gt;&lt;LI-CODE lang="python"&gt;targets:
  prod:
    resources:
      jobs:
        job1:
          schedule:
            quartz_cron_expression: "0 0 */2 * * ?"  # Every 2 hours
        
        job2:
          schedule:
            quartz_cron_expression: "0 0 6 * * ?"    # Daily at 6am&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Aug 2026 11:07:02 GMT</pubDate>
    <dc:creator>balajij8</dc:creator>
    <dc:date>2026-08-17T11:07:02Z</dc:date>
    <item>
      <title>If statement in DAB YAML file support</title>
      <link>https://community.databricks.com/t5/data-engineering/if-statement-in-dab-yaml-file-support/m-p/165774#M55482</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;Is there a plan to have if statement support in DAB YAML file?&lt;/P&gt;&lt;P&gt;For example, I would like to have different schedule for jobs based on the environment (higher frequency in PROD, lower frequency in DEV, QA). How can I do it in Databricks via workflow yml files?&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2026 08:17:59 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/if-statement-in-dab-yaml-file-support/m-p/165774#M55482</guid>
      <dc:creator>QuanDo1</dc:creator>
      <dc:date>2026-08-17T08:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: If statement in DAB YAML file support</title>
      <link>https://community.databricks.com/t5/data-engineering/if-statement-in-dab-yaml-file-support/m-p/165779#M55483</link>
      <description>&lt;P&gt;Hi QuanDo1,&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="3"&gt;DABs handle environment-specific schedules natively through declarative target variable overrides instead of relying on procedural if statements. You define top-level variables in yml (job_schedule_cron,job_schedule_timezone) and assign baseline defaults that act as fallbacks. Under each target definition (dev, qa, prod), you override these values according to environment requirements - setting job_schedule_cron to a weekly cron expression for dev, daily for qa&amp;nbsp;and every two hours for prod. In the job definition under resources/jobs.yml, you can reference the variable directly as var.job_schedule_cron allowing DABs to resolve and substitute the schedule dynamically from variables.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;LI-CODE lang="python"&gt;targets:
  dev:
    default: true
    mode: development
    variables:
      job_schedule_cron: "0 0 9 ? * MON"  # Weekly on Mondays at 9am
      environment: "dev"
  
  qa:
    mode: development
    variables:
      job_schedule_cron: "0 0 6 * * ?"  # Daily at 6am
      environment: "qa"&lt;/LI-CODE&gt;&lt;DIV class=""&gt;&lt;FONT&gt;When executing bundles the CLI reads the relevant&amp;nbsp;dev/qa/prod substitutes the cron expression&amp;nbsp;wherever var.job_schedule_cron is referenced in the resources, and provisions a job scheduled based on it.&amp;nbsp;&lt;/FONT&gt;&lt;FONT&gt;It provides type-safety through default values, keeps schedule differences transparent during code reviews and scales cleanly to parameterize other scheduling attributes such as execution timezones or the pause_status toggle without introducing conditional template logic.&lt;/FONT&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 17 Aug 2026 09:29:28 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/if-statement-in-dab-yaml-file-support/m-p/165779#M55483</guid>
      <dc:creator>balajij8</dc:creator>
      <dc:date>2026-08-17T09:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: If statement in DAB YAML file support</title>
      <link>https://community.databricks.com/t5/data-engineering/if-statement-in-dab-yaml-file-support/m-p/165780#M55484</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/248078"&gt;@QuanDo1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;You don't need to use if/else for this use case. Databricks Asset Bundles (DAB) already supports variables that can be overridden per target environment.&lt;/P&gt;&lt;P&gt;You can define your variables once and then assign different values for each target (dev, qa, prod). This keeps your bundle clean and avoids conditional logic in the YAML.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;bundle:
  name: dynamic-scheduler-demo

variables:
  job_cron_schedule:
    description: "The cron expression for running the workflow"
    default: "0 0 12 * * ?"

  job_timezone:
    description: "The timezone for the schedule"
    default: "UTC"

targets:
  dev:
    mode: development
    default: true
    variables:
      job_cron_schedule: "0 0/15 * * * ?"  # Every 15 minutes

resources:
  jobs:
    my_scheduled_job:
      name: "My Scheduled Data Pipeline"
      schedule:
        quartz_cron_expression: "${var.job_cron_schedule}"
        timezone_id: "${var.job_timezone}"
        pause_status: "UNPAUSED"&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 17 Aug 2026 09:50:21 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/if-statement-in-dab-yaml-file-support/m-p/165780#M55484</guid>
      <dc:creator>Niyojit</dc:creator>
      <dc:date>2026-08-17T09:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: If statement in DAB YAML file support</title>
      <link>https://community.databricks.com/t5/data-engineering/if-statement-in-dab-yaml-file-support/m-p/165781#M55485</link>
      <description>&lt;P data-unlink="true"&gt;Hi&amp;nbsp;&lt;SPAN class=""&gt;balajij8&lt;/SPAN&gt;,&amp;nbsp;&lt;SPAN class=""&gt;Niyojit&lt;/SPAN&gt;&lt;BR /&gt;I understand the approach. In my opinion, this is suitable only for small number of pipelines, or local development, what if I have many pipelines, I wouldn't want them to run all at the same time, having the flexibility to customize each pipeline is I think more suitable for professional use cases?&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2026 09:53:49 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/if-statement-in-dab-yaml-file-support/m-p/165781#M55485</guid>
      <dc:creator>QuanDo1</dc:creator>
      <dc:date>2026-08-17T09:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: If statement in DAB YAML file support</title>
      <link>https://community.databricks.com/t5/data-engineering/if-statement-in-dab-yaml-file-support/m-p/165782#M55486</link>
      <description>&lt;P&gt;What i think is for many pipelines or production-scale deployments, you would typically define pipeline-specific variables (or separate variables per workflow) and override them per target (dev, qa, prod). This gives each pipeline its own schedule while still keeping the configuration centralized.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2026 09:59:43 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/if-statement-in-dab-yaml-file-support/m-p/165782#M55486</guid>
      <dc:creator>Niyojit</dc:creator>
      <dc:date>2026-08-17T09:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: If statement in DAB YAML file support</title>
      <link>https://community.databricks.com/t5/data-engineering/if-statement-in-dab-yaml-file-support/m-p/165783#M55487</link>
      <description>&lt;P&gt;Quan,&lt;/P&gt;&lt;P&gt;Instead of using&amp;nbsp;global variables&amp;nbsp;that apply the same schedule to all jobs, you override the schedule&amp;nbsp;individually for each pipeline&amp;nbsp;within each environment target. It gives you&amp;nbsp;full control&amp;nbsp;over every pipeline's timing in every environment.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2026 10:25:54 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/if-statement-in-dab-yaml-file-support/m-p/165783#M55487</guid>
      <dc:creator>balajij8</dc:creator>
      <dc:date>2026-08-17T10:25:54Z</dc:date>
    </item>
    <item>
      <title>Re: If statement in DAB YAML file support</title>
      <link>https://community.databricks.com/t5/data-engineering/if-statement-in-dab-yaml-file-support/m-p/165789#M55488</link>
      <description>&lt;P&gt;balajij8,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Sounds promising, could you elaborate on this? Perhaps a quick example&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2026 10:50:25 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/if-statement-in-dab-yaml-file-support/m-p/165789#M55488</guid>
      <dc:creator>QuanDo1</dc:creator>
      <dc:date>2026-08-17T10:50:25Z</dc:date>
    </item>
    <item>
      <title>Re: If statement in DAB YAML file support</title>
      <link>https://community.databricks.com/t5/data-engineering/if-statement-in-dab-yaml-file-support/m-p/165790#M55489</link>
      <description>&lt;P&gt;Quan,&lt;/P&gt;&lt;P&gt;You can follow below&lt;/P&gt;&lt;LI-CODE lang="python"&gt;targets:
  prod:
    resources:
      jobs:
        job1:
          schedule:
            quartz_cron_expression: "0 0 */2 * * ?"  # Every 2 hours
        
        job2:
          schedule:
            quartz_cron_expression: "0 0 6 * * ?"    # Daily at 6am&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2026 11:07:02 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/if-statement-in-dab-yaml-file-support/m-p/165790#M55489</guid>
      <dc:creator>balajij8</dc:creator>
      <dc:date>2026-08-17T11:07:02Z</dc:date>
    </item>
  </channel>
</rss>

