-
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 allow-control-over-ephemeral-cte-identifier
- Loading branch information
Showing
54 changed files
with
490 additions
and
130 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
## dbt-adapter 1.0.0 - April 01, 2024 | ||
## dbt-adapters 1.0.0 - April 01, 2024 | ||
|
||
### Fixes | ||
|
||
|
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,4 +1,4 @@ | ||
## dbt-adapter 1.1.0 - May 01, 2024 | ||
## dbt-adapters 1.1.0 - May 01, 2024 | ||
|
||
### Features | ||
|
||
|
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,4 +1,4 @@ | ||
## dbt-adapter 1.1.1 - May 07, 2024 | ||
## dbt-adapters 1.1.1 - May 07, 2024 | ||
|
||
### Features | ||
|
||
|
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,4 +1,4 @@ | ||
## dbt-adapter 1.2.1 - May 21, 2024 | ||
## dbt-adapters 1.2.1 - May 21, 2024 | ||
|
||
### Features | ||
|
||
|
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,6 @@ | ||
## dbt-adapters 1.3.2 - July 02, 2024 | ||
|
||
### Under the Hood | ||
|
||
* Fix query timer resolution | ||
* Add optional release_connection parameter to connection_named method |
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,9 @@ | ||
## dbt-adapters 1.3.3 - July 09, 2024 | ||
|
||
### Fixes | ||
|
||
* Fix scenario where using the `--empty` flag causes metadata queries to contain limit clauses | ||
|
||
### Under the Hood | ||
|
||
* --limit flag no longer subshells the query. This resolves the dbt Cloud experience issue where limit prevents ordering elements.. |
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,4 +1,4 @@ | ||
## dbt-adapter 1.8.0 - May 09, 2024 | ||
## dbt-adapters 1.8.0 - May 09, 2024 | ||
|
||
### Features | ||
|
||
|
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 @@ | ||
## dbt-adapters 1.9.2 - July 09, 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
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 |
---|---|---|
|
@@ -7,5 +7,5 @@ contact_links: | |
url: mailto:[email protected] | ||
about: Are you using dbt Cloud? Contact our support team for help! | ||
- name: Participate in Discussions | ||
url: https://github.com/dbt-labs/dbt-adapter/discussions | ||
about: Do you have a Big Idea for dbt-adapter? Read open discussions, or start a new one | ||
url: https://github.com/dbt-labs/dbt-adapters/discussions | ||
about: Do you have a Big Idea for dbt-adapters? Read open discussions, or start a new one |
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
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 |
---|---|---|
|
@@ -154,3 +154,13 @@ cython_debug/ | |
|
||
# PyCharm | ||
.idea/ | ||
|
||
# MacOS | ||
.DS_Store | ||
|
||
# vscode | ||
.vscode/ | ||
.venv/ | ||
|
||
# Vim | ||
*.swp |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
version = "1.8.0" | ||
version = "1.9.2" |
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 |
Oops, something went wrong.