1

My DBT project is highly dependent on receiving variables at runtime. When I pass these variables using the below command I get an error from DBT. The command complies 100% with the documentation . I have no idea why DBT will reject this command

dbt parse --profiles-dir . --target dev --vars '{"client_name": "ecc6_test_client","fiscal_start_month_number": "3","fiscal_year": "2020"}'

Here is the error:

...
dbt: error: unrecognized arguments: ecc6_test_client,fiscal_start_month_number: 3,fiscal_year: 2020}'

These variables are also defined in my dbt_project.yml, but I need to override them at runtime

vars:
  # Client name
  client_name: "ecc6_test_client_1"
  # Fiscal period start month as number
  fiscal_start_month_number: "1"
  # Fiscal year
  fiscal_year: "2000"
  # Source Schema
  source_schema: "ecc6_test_client_1_2000"

When I run dbt without the --vars it executes without any issue

Lambo
  • 1,094
  • 11
  • 18
  • 2
    I've had this issue before using dbt on Windows, take a look at this https://github.com/dbt-labs/dbt-core/issues/4066 you may need to change the quotes you use – Simeon Oct 20 '22 at 10:10
  • 1
    Which shell are you using? I think Simeon is right about this if you're using the windows command prompt – tconbeer Oct 21 '22 at 17:55
  • I'm using command prompt - when I run the command as: dbt parse --profiles-dir . --target dev --vars "{client_name: ecc6_test_client,fiscal_start_month_number: 3,fiscal_year: 2020}" it works -> https://github.com/dbt-labs/docs.getdbt.com/issues/620 – Lambo Oct 24 '22 at 02:35

1 Answers1

1

Solution mentioned in https://github.com/dbt-labs/docs.getdbt.com/issues/620

Change the quotes, add the dictionary string within double quotes

dbt parse --profiles-dir . --target dev --vars "{client_name: ecc6_test_client,fiscal_start_month_number: 3,fiscal_year: 2020}"
Lambo
  • 1,094
  • 11
  • 18