Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix connection issue in dbt 1.0.0 (#2230)
* Fix connection issue in dbt 1.0.0 * Set tests to use default Postgres database * Add postgres service to GH action ci tests * Fix test__templater_dbt_handle_database_connection_failure * Fixing * Correct database connection test * Add real incremental model to test database connection * Use mock to simulate database failure in "test__templater_dbt_handle_database_connection_failure" * Attempt to ignore templator tests for Windows * Move more tests * Linting fixes * Revert "Linting fixes" This reverts commit 68b1bfb. * Revert "Move more tests" This reverts commit 2a5e662. * Revert "Attempt to ignore templator tests for Windows" This reverts commit ca71069. * Attempt 2 to skip the tests for windows * Linting * Skip test on dbt versions below 1.0 * CONTRIBUTING.md: Document the dbt Docker Compose environment * jy_cleanup (#2257) * jy_cleanup * Remove unnecessary dbt_connection mark Co-authored-by: Barry Hart <barry.hart@mailchimp.com> Co-authored-by: Barry <barry@tunetheweb.com> Co-authored-by: Joseph Young <80432516+jpy-git@users.noreply.github.com>
- Loading branch information
1 parent
3861582
commit 286a526
Showing
9 changed files
with
108 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 10 additions & 4 deletions
14
...qlfluff-templater-dbt/test/fixtures/dbt/dbt_project/models/my_new_project/incremental.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
-- https://github.com/sqlfluff/sqlfluff/issues/780 | ||
-- Note we don't call is_incremental directly in the test | ||
-- because that requires a database connection. | ||
|
||
{{ | ||
config( | ||
materialized = 'incremental', | ||
unique_key='product_id' | ||
) | ||
}} | ||
|
||
select | ||
{#- Attributes #} | ||
products.product_id, | ||
products.valid_date_local, | ||
products._fivetran_deleted | ||
from products | ||
inner join dispensaries | ||
where not products._fivetran_deleted | ||
{% if true -%} | ||
{% if is_incremental() -%} | ||
and products.valid_date_local >= ( | ||
select max(valid_date_local) from {{ this }}) | ||
{% endif %} | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
plugins/sqlfluff-templater-dbt/test/fixtures/dbt/profiles_yml_fail/profiles.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
default: | ||
target: dev | ||
outputs: | ||
dev: | ||
type: postgres | ||
host: localhost | ||
user: postgres | ||
pass: password | ||
port: 2345 | ||
dbname: postgres | ||
schema: dbt_alice | ||
threads: 4 | ||
|
||
config: | ||
send_anonymous_usage_stats: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters