From 2ee53d372717d4f2b2eb11634c11abd4b57a50e6 Mon Sep 17 00:00:00 2001 From: Mike Alfare <13974384+mikealfare@users.noreply.github.com> Date: Thu, 6 Jul 2023 12:24:48 -0400 Subject: [PATCH 1/5] Add new `defer_relation` argument to `mock_model` (#520) * add new `defer_relation` argument to `mock_model` * changie * exclude redshift-connector==2.0.912 (#519) --- .changes/unreleased/Fixes-20230706-001056.yaml | 6 ++++++ .changes/unreleased/Fixes-20230706-012233.yaml | 6 ++++++ setup.py | 2 +- tests/unit/test_context.py | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 .changes/unreleased/Fixes-20230706-001056.yaml create mode 100644 .changes/unreleased/Fixes-20230706-012233.yaml diff --git a/.changes/unreleased/Fixes-20230706-001056.yaml b/.changes/unreleased/Fixes-20230706-001056.yaml new file mode 100644 index 000000000..79b205caf --- /dev/null +++ b/.changes/unreleased/Fixes-20230706-001056.yaml @@ -0,0 +1,6 @@ +kind: Fixes +body: Fix regression in redshift-connector==2.0.912 +time: 2023-07-06T00:10:56.337407-04:00 +custom: + Author: mikealfare + Issue: "518" diff --git a/.changes/unreleased/Fixes-20230706-012233.yaml b/.changes/unreleased/Fixes-20230706-012233.yaml new file mode 100644 index 000000000..bc28b2eec --- /dev/null +++ b/.changes/unreleased/Fixes-20230706-012233.yaml @@ -0,0 +1,6 @@ +kind: Fixes +body: Fixed unit test that broke following dbt clone work +time: 2023-07-06T01:22:33.840137-04:00 +custom: + Author: mikealfare + Issue: "518" diff --git a/setup.py b/setup.py index 56d4fa101..3dd9e7913 100644 --- a/setup.py +++ b/setup.py @@ -85,7 +85,7 @@ def _core_version(plugin_version: str = _plugin_version()) -> str: f"dbt-core~={_core_version()}", f"dbt-postgres~={_core_version()}", "boto3~=1.26.26", - "redshift-connector~=2.0.911", + "redshift-connector~=2.0.911,!=2.0.912", # installed via dbt-core but referenced directly; don't pin to avoid version conflicts with dbt-core "agate", ], diff --git a/tests/unit/test_context.py b/tests/unit/test_context.py index 542387c0d..31c436d82 100644 --- a/tests/unit/test_context.py +++ b/tests/unit/test_context.py @@ -147,6 +147,7 @@ def mock_model(): raw_sql="", description="", columns={}, + defer_relation=None, ) From 6254fddded2997d4ae5176eaeaf13eb2b63158f4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 6 Jul 2023 13:29:10 -0400 Subject: [PATCH 2/5] Update pip-tools requirement from ~=6.13 to ~=6.14 (#517) * Update pip-tools requirement from ~=6.13 to ~=6.14 Updates the requirements on [pip-tools](https://github.com/jazzband/pip-tools) to permit the latest version. - [Release notes](https://github.com/jazzband/pip-tools/releases) - [Changelog](https://github.com/jazzband/pip-tools/blob/main/CHANGELOG.md) - [Commits](https://github.com/jazzband/pip-tools/compare/6.13.0...6.14.0) --- updated-dependencies: - dependency-name: pip-tools dependency-type: direct:development ... Signed-off-by: dependabot[bot] * Add automated changelog yaml from template for bot PR --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Github Build Bot Co-authored-by: Mike Alfare <13974384+mikealfare@users.noreply.github.com> Co-authored-by: Mike Alfare --- .changes/unreleased/Dependencies-20230703-190419.yaml | 6 ++++++ dev-requirements.txt | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changes/unreleased/Dependencies-20230703-190419.yaml diff --git a/.changes/unreleased/Dependencies-20230703-190419.yaml b/.changes/unreleased/Dependencies-20230703-190419.yaml new file mode 100644 index 000000000..d736196a3 --- /dev/null +++ b/.changes/unreleased/Dependencies-20230703-190419.yaml @@ -0,0 +1,6 @@ +kind: "Dependencies" +body: "Update pip-tools requirement from ~=6.13 to ~=6.14" +time: 2023-07-03T19:04:19.00000Z +custom: + Author: dependabot[bot] + PR: 517 diff --git a/dev-requirements.txt b/dev-requirements.txt index bed71ec05..f4e1ecdae 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -14,7 +14,7 @@ flaky~=3.7 freezegun~=1.2 ipdb~=0.13.13 mypy==1.4.1 # patch updates have historically introduced breaking changes -pip-tools~=6.13 +pip-tools~=6.14 pre-commit~=3.3 pre-commit-hooks~=4.4 pytest~=7.4 From 919b39140412ff4ec616832ebc59aff4258139da Mon Sep 17 00:00:00 2001 From: Jessie Chen <121250701+jiezhen-chen@users.noreply.github.com> Date: Thu, 6 Jul 2023 16:43:03 -0700 Subject: [PATCH 3/5] cast port as integer (#523) * cast port as integer * remove pin to exclude rs_connector 2.0.912 --- .changes/unreleased/Fixes-20230706-123329.yaml | 6 ++++++ dbt/adapters/redshift/connections.py | 2 +- setup.py | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .changes/unreleased/Fixes-20230706-123329.yaml diff --git a/.changes/unreleased/Fixes-20230706-123329.yaml b/.changes/unreleased/Fixes-20230706-123329.yaml new file mode 100644 index 000000000..afda869d0 --- /dev/null +++ b/.changes/unreleased/Fixes-20230706-123329.yaml @@ -0,0 +1,6 @@ +kind: Fixes +body: cast the port as an int +time: 2023-07-06T12:33:29.799921-07:00 +custom: + Author: jiezhen-chen + Issue: "518" diff --git a/dbt/adapters/redshift/connections.py b/dbt/adapters/redshift/connections.py index cd653d781..9b4363b42 100644 --- a/dbt/adapters/redshift/connections.py +++ b/dbt/adapters/redshift/connections.py @@ -180,7 +180,7 @@ def get_connect_method(self): kwargs = { "host": self.credentials.host, "database": self.credentials.database, - "port": self.credentials.port if self.credentials.port else 5439, + "port": int(self.credentials.port) if self.credentials.port else int(5439), "auto_create": self.credentials.autocreate, "db_groups": self.credentials.db_groups, "region": self.credentials.region, diff --git a/setup.py b/setup.py index 3dd9e7913..56d4fa101 100644 --- a/setup.py +++ b/setup.py @@ -85,7 +85,7 @@ def _core_version(plugin_version: str = _plugin_version()) -> str: f"dbt-core~={_core_version()}", f"dbt-postgres~={_core_version()}", "boto3~=1.26.26", - "redshift-connector~=2.0.911,!=2.0.912", + "redshift-connector~=2.0.911", # installed via dbt-core but referenced directly; don't pin to avoid version conflicts with dbt-core "agate", ], From 1f1e863b6dd66214d9ec2fb9a48bebcfb57fb909 Mon Sep 17 00:00:00 2001 From: Nathaniel May Date: Mon, 10 Jul 2023 13:17:56 -0400 Subject: [PATCH 4/5] update pr template --- .github/pull_request_template.md | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 3ba410716..f3fe5ac83 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,26 +1,35 @@ -resolves # +resolves # +[docs](https://github.com/dbt-labs/docs.getdbt.com/issues/new/choose) dbt-labs/docs.getdbt.com/# -### Description +### Problem + +### Solution + + ### Checklist -- [ ] I have read [the contributing guide](https://github.com/dbt-labs/dbt-redshift/blob/main/CONTRIBUTING.md) and understand what's expected of me -- [ ] I have signed the [CLA](https://docs.getdbt.com/docs/contributor-license-agreements) -- [ ] I have run this code in development and it appears to resolve the stated issue +- [ ] I have read [the contributing guide](https://github.com/dbt-labs/dbt-core/blob/main/CONTRIBUTING.md) and understand what's expected of me +- [ ] I have run this code in development and it appears to resolve the stated issue - [ ] This PR includes tests, or tests are not required/relevant for this PR -- [ ] I have [opened an issue to add/update docs](https://github.com/dbt-labs/docs.getdbt.com/issues/new/choose), or docs changes are not required/relevant for this PR -- [ ] I have run `changie new` to [create a changelog entry](https://github.com/dbt-labs/dbt-redshift/blob/main/CONTRIBUTING.md#Adding-CHANGELOG-Entry) +- [ ] This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX From 693adb7343f23eb21e852a3b382bd7679b3b8b9a Mon Sep 17 00:00:00 2001 From: Matthew McKnight <91097623+McKnight-42@users.noreply.github.com> Date: Tue, 11 Jul 2023 11:27:12 -0500 Subject: [PATCH 5/5] fix whitespace change (#528) --- .github/pull_request_template.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index f3fe5ac83..a3c340cc3 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,5 +1,5 @@ -resolves # -[docs](https://github.com/dbt-labs/docs.getdbt.com/issues/new/choose) dbt-labs/docs.getdbt.com/# +resolves # +[docs](https://github.com/dbt-labs/docs.getdbt.com/issues/new/choose) dbt-labs/docs.getdbt.com/#