Ahh OK! On your first run, the table doesn’t exist.
The standard solution for this is to use the is_incremental() macro. It will return false unless the table alrady exists (and you’re not running a --full-refresh
- check the doc for the full rundown).
You need to write your model in such a way that it works whether or not the table already exists, to enable dbt to run in an idempotent way.