Threads cannot be configured with an environment variable.
Setting an environment variable "THREADS" with my profile set as
threads: "{{ env_var('THREADS') }}" throws the following error:
Encountered an error while reading profiles:
ERROR Runtime Error
at path ['threads']: '8' is not of type 'integer'
In this example, I would have expected the run command to work with 8 threads.
Which database are you using dbt with?
The output of dbt --version:
installed version: 0.15.2
latest version: 0.16.1
MacOs + Linux
The output of python --version:
Python 3.7.4
This seems to work fine with ports but not for threads. It may also be an issue with other fields that expect integers like Timeouts / Retries in BigQuery profiles.
Thanks for the writeup!
Could you try running this again using the latest release candidate of dbt v0.17.0? The new version includes a change (https://github.com/fishtown-analytics/dbt/pull/2357) that renders all YML files, including profiles.yml, within the native env. A Jinja expression that returns an integer should be able to pass an integer to the config.
Sorry for the delay - I can confirm this works after upgrading to v0.17. It also fixed the variables for BigQuery profiles.
Thanks guys, I'll leave it to you to close this issue, it may suit you better to close when 0.17 moves out of RC.
thanks for the update @keiththompson!
Most helpful comment
Thanks for the writeup!
Could you try running this again using the latest release candidate of dbt v0.17.0? The new version includes a change (https://github.com/fishtown-analytics/dbt/pull/2357) that renders all YML files, including
profiles.yml, within the native env. A Jinja expression that returns an integer should be able to pass an integer to the config.