Fix non-default project names not working in dbt-sql template (#1500)

## Changes
Hello Team,

While tinkering with your solution, I've noticed that profiles provided
in dbt_project.yml and profiles.yml for generated dbt asset bundles. do
not align. This led to the following error, when deploying DAB:
```
+ dbt deps --target=dev
11:24:02  Running with dbt=1.8.2
11:24:02  Warning: No packages were found in packages.yml
11:24:02  Warning: No packages were found in packages.yml

+ dbt seed --target=dev --vars '{ dev_schema: mateusz_kijewski }'
11:24:05  Running with dbt=1.8.2
11:24:05  Encountered an error:
Runtime Error
  Could not find profile named 'dbt_sql'
```

I have corrected profile name in profiles.yml.tmpl to the name used in
dbt_project.yml.tmpl. Using the opportunity of forking your repo, I've
also updated tests configuration in model config as starting of dbt v1.8
it's been raising warnings of configuration change from tests to
data_tests
```
11:31:34  [WARNING]: Deprecated functionality
The `tests` config has been renamed to `data_tests`. Please see
https://docs.getdbt.com/docs/build/data-tests#new-data_tests-syntax for more
information.
```

## Tests
<!-- How is this tested? -->
This commit is contained in:
kijewskimateusz 2024-07-01 09:52:22 +02:00 committed by GitHub
parent aee3910f3d
commit c7a36921b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 5 additions and 5 deletions

View File

@ -3,7 +3,7 @@
{{- $catalog = "\"\" # workspace default"}}
{{- end}}
# This file defines dbt profiles for deployed dbt jobs.
my_dbt_project:
{{.project_name}}:
target: dev # default target
outputs:

View File

@ -1,3 +1,3 @@
## requirements-dev.txt: dependencies for local development.
dbt-databricks>=1.0.0,<2.0.0
dbt-databricks>=1.8.0,<2.0.0

View File

@ -35,7 +35,7 @@ resources:
libraries:
- pypi:
package: dbt-databricks>=1.0.0,<2.0.0
package: dbt-databricks>=1.8.0,<2.0.0
new_cluster:
spark_version: {{template "latest_lts_dbr_version"}}

View File

@ -7,7 +7,7 @@ models:
columns:
- name: customer_name
description: "The name of a customer"
tests:
data_tests:
- unique
- not_null
@ -16,6 +16,6 @@ models:
columns:
- name: order_date
description: "The date on which orders took place"
tests:
data_tests:
- unique
- not_null