-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into paw/fix-timer-resolution
- Loading branch information
Showing
14 changed files
with
181 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
## dbt-adapters 1.3.0 - June 18, 2024 | ||
|
||
### Features | ||
|
||
* Add get_catalog_for_single_relation macro and capability to enable adapters to optimize catalog generation |
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 @@ | ||
## dbt-adapters 1.3.1 - June 20, 2024 |
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 @@ | ||
## dbt-adapters 1.9.0 - June 18, 2024 |
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 @@ | ||
## dbt-adapters 1.9.1 - June 20, 2024 |
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,41 @@ | ||
# **what?** | ||
# Open an issue in docs.getdbt.com when an issue is labeled `user docs` and closed as completed | ||
|
||
# **why?** | ||
# To reduce barriers for keeping docs up to date | ||
|
||
# **when?** | ||
# When an issue is labeled `user docs` and is closed as completed. Can be labeled before or after the issue is closed. | ||
|
||
|
||
name: Open issues in docs.getdbt.com repo when an issue is labeled | ||
run-name: "Open an issue in docs.getdbt.com for issue #${{ github.event.issue.number }}" | ||
|
||
on: | ||
issues: | ||
types: [labeled, closed] | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
permissions: | ||
issues: write # comments on issues | ||
|
||
jobs: | ||
open_issues: | ||
# we only want to run this when the issue is closed as completed and the label `user docs` has been assigned. | ||
# If this logic does not exist in this workflow, it runs the | ||
# risk of duplicaton of issues being created due to merge and label both triggering this workflow to run and neither having | ||
# generating the comment before the other runs. This lives here instead of the shared workflow because this is where we | ||
# decide if it should run or not. | ||
if: | | ||
(github.event.issue.state == 'closed' && github.event.issue.state_reason == 'completed') && ( | ||
(github.event.action == 'closed' && contains(github.event.issue.labels.*.name, 'user docs')) || | ||
(github.event.action == 'labeled' && github.event.label.name == 'user docs')) | ||
uses: dbt-labs/actions/.github/workflows/open-issue-in-repo.yml@main | ||
with: | ||
issue_repository: "dbt-labs/docs.getdbt.com" | ||
issue_title: "Docs Changes Needed from ${{ github.event.repository.name }} Issue #${{ github.event.issue.number }}" | ||
issue_body: "At a minimum, update body to include a link to the page on docs.getdbt.com requiring updates and what part(s) of the page you would like to see updated." | ||
secrets: inherit |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
version = "1.8.0" | ||
version = "1.9.1" |
87 changes: 87 additions & 0 deletions
87
dbt-tests-adapter/dbt/tests/adapter/basic/test_get_catalog_for_single_relation.py
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,87 @@ | ||
import pytest | ||
|
||
from dbt.tests.util import run_dbt, get_connection | ||
|
||
models__my_table_model_sql = """ | ||
select * from {{ ref('my_seed') }} | ||
""" | ||
|
||
|
||
models__my_view_model_sql = """ | ||
{{ | ||
config( | ||
materialized='view', | ||
) | ||
}} | ||
select * from {{ ref('my_seed') }} | ||
""" | ||
|
||
seed__my_seed_csv = """id,first_name,email,ip_address,updated_at | ||
1,Larry,[email protected],69.135.206.194,2008-09-12 19:08:31 | ||
""" | ||
|
||
|
||
class BaseGetCatalogForSingleRelation: | ||
@pytest.fixture(scope="class") | ||
def project_config_update(self): | ||
return {"name": "get_catalog_for_single_relation"} | ||
|
||
@pytest.fixture(scope="class") | ||
def seeds(self): | ||
return { | ||
"my_seed.csv": seed__my_seed_csv, | ||
} | ||
|
||
@pytest.fixture(scope="class") | ||
def models(self): | ||
return { | ||
"my_view_model.sql": models__my_view_model_sql, | ||
"my_table_model.sql": models__my_table_model_sql, | ||
} | ||
|
||
@pytest.fixture(scope="class") | ||
def expected_catalog_my_seed(self, project): | ||
raise NotImplementedError( | ||
"To use this test, please implement `get_catalog_for_single_relation`, inherited from `SQLAdapter`." | ||
) | ||
|
||
@pytest.fixture(scope="class") | ||
def expected_catalog_my_model(self, project): | ||
raise NotImplementedError( | ||
"To use this test, please implement `get_catalog_for_single_relation`, inherited from `SQLAdapter`." | ||
) | ||
|
||
def get_relation_for_identifier(self, project, identifier): | ||
return project.adapter.get_relation( | ||
database=project.database, | ||
schema=project.test_schema, | ||
identifier=identifier, | ||
) | ||
|
||
def test_get_catalog_for_single_relation( | ||
self, project, expected_catalog_my_seed, expected_catalog_my_view_model | ||
): | ||
results = run_dbt(["seed"]) | ||
assert len(results) == 1 | ||
|
||
my_seed_relation = self.get_relation_for_identifier(project, "my_seed") | ||
|
||
with get_connection(project.adapter): | ||
actual_catalog_my_seed = project.adapter.get_catalog_for_single_relation( | ||
my_seed_relation | ||
) | ||
|
||
assert actual_catalog_my_seed == expected_catalog_my_seed | ||
|
||
results = run_dbt(["run"]) | ||
assert len(results) == 2 | ||
|
||
my_view_model_relation = self.get_relation_for_identifier(project, "my_view_model") | ||
|
||
with get_connection(project.adapter): | ||
actual_catalog_my_view_model = project.adapter.get_catalog_for_single_relation( | ||
my_view_model_relation | ||
) | ||
|
||
assert actual_catalog_my_view_model == expected_catalog_my_view_model |
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 +1 @@ | ||
version = "1.2.1" | ||
version = "1.3.1" |
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
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