kestra-io / plugin-dbt

Apache License 2.0
8 stars 4 forks source link

Don't emit the warning if projectDir is specified #139

Closed anna-geller closed 2 weeks ago

anna-geller commented 2 weeks ago

Issue description

Follow up to https://github.com/kestra-io/plugin-dbt/issues/127

The warning is useful, the only issue is that it shows up even if you did specify projectDir — we should only show it if projectDir is not set but the --project-dir flag is used.

image

id: dwh_and_analytics
namespace: company.team
description: |
  ## Data Platform
  Clone a [Git repository](https://github.com/kestra-io/dbt-example) and build dbt models

tasks:
  - id: dbt
    type: io.kestra.plugin.core.flow.WorkingDirectory
    tasks:
    - id: clone_repository
      type: io.kestra.plugin.git.Clone
      url: https://github.com/kestra-io/dbt-example
      branch: master

    - id: dbt_build
      type: io.kestra.plugin.dbt.cli.DbtCLI
      taskRunner:
        type: io.kestra.plugin.scripts.runner.docker.Docker
      containerImage: ghcr.io/kestra-io/dbt-duckdb:latest
      projectDir: dbt # the issue is here -- warning still shows ❌ 
      commands:
        - dbt deps --project-dir dbt --target prod
        - dbt build --project-dir dbt --target prod
      profiles: |
        my_dbt_project:
          outputs:
            dev:
              type: duckdb
              path: dbt.duckdb
              extensions: 
                - parquet
              fixed_retries: 1
              threads: 16
              timeout_seconds: 300
            prod:
              type: duckdb
              path: dbt2.duckdb
              extensions: 
                - parquet
              fixed_retries: 1
              threads: 16
              timeout_seconds: 300
          target: dev