From 5836b0e379881ebffe124ebe646b389e011db415 Mon Sep 17 00:00:00 2001 From: Github Build Bot Date: Tue, 16 Apr 2024 21:32:07 +0000 Subject: [PATCH 1/4] Bumping version to 1.0.8b3 and generate changelog --- .changes/1.0.8-b3.md | 12 ++++++++++++ .../Features-20240323-160251.yaml | 0 .../Features-20240325-180611.yaml | 0 .../Features-20240409-084844.yaml | 0 .../Under the Hood-20240329-093307.yaml | 0 .../Under the Hood-20240410-184109.yaml | 0 CHANGELOG.md | 13 +++++++++++++ dbt/adapters/__about__.py | 2 +- 8 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 .changes/1.0.8-b3.md rename .changes/{unreleased => 1.0.8}/Features-20240323-160251.yaml (100%) rename .changes/{unreleased => 1.0.8}/Features-20240325-180611.yaml (100%) rename .changes/{unreleased => 1.0.8}/Features-20240409-084844.yaml (100%) rename .changes/{unreleased => 1.0.8}/Under the Hood-20240329-093307.yaml (100%) rename .changes/{unreleased => 1.0.8}/Under the Hood-20240410-184109.yaml (100%) diff --git a/.changes/1.0.8-b3.md b/.changes/1.0.8-b3.md new file mode 100644 index 00000000..4c613d15 --- /dev/null +++ b/.changes/1.0.8-b3.md @@ -0,0 +1,12 @@ +## dbt-adapter 1.0.8-b3 - April 16, 2024 + +### Features + +* Debug log when `type_code` fails to convert to a `data_type` +* Introduce TableLastModifiedMetadataBatch and implement BaseAdapter.calculate_freshness_from_metadata_batch +* Support for sql fixtures in unit testing + +### Under the Hood + +* Add the option to set the log level of the AdapterRegistered event +* Update dependabot config to cover GHA diff --git a/.changes/unreleased/Features-20240323-160251.yaml b/.changes/1.0.8/Features-20240323-160251.yaml similarity index 100% rename from .changes/unreleased/Features-20240323-160251.yaml rename to .changes/1.0.8/Features-20240323-160251.yaml diff --git a/.changes/unreleased/Features-20240325-180611.yaml b/.changes/1.0.8/Features-20240325-180611.yaml similarity index 100% rename from .changes/unreleased/Features-20240325-180611.yaml rename to .changes/1.0.8/Features-20240325-180611.yaml diff --git a/.changes/unreleased/Features-20240409-084844.yaml b/.changes/1.0.8/Features-20240409-084844.yaml similarity index 100% rename from .changes/unreleased/Features-20240409-084844.yaml rename to .changes/1.0.8/Features-20240409-084844.yaml diff --git a/.changes/unreleased/Under the Hood-20240329-093307.yaml b/.changes/1.0.8/Under the Hood-20240329-093307.yaml similarity index 100% rename from .changes/unreleased/Under the Hood-20240329-093307.yaml rename to .changes/1.0.8/Under the Hood-20240329-093307.yaml diff --git a/.changes/unreleased/Under the Hood-20240410-184109.yaml b/.changes/1.0.8/Under the Hood-20240410-184109.yaml similarity index 100% rename from .changes/unreleased/Under the Hood-20240410-184109.yaml rename to .changes/1.0.8/Under the Hood-20240410-184109.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a024c80..63dc2e36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), and is generated by [Changie](https://github.com/miniscruff/changie). +## dbt-adapter 1.0.8-b3 - April 16, 2024 + +### Features + +* Debug log when `type_code` fails to convert to a `data_type` +* Introduce TableLastModifiedMetadataBatch and implement BaseAdapter.calculate_freshness_from_metadata_batch +* Support for sql fixtures in unit testing + +### Under the Hood + +* Add the option to set the log level of the AdapterRegistered event +* Update dependabot config to cover GHA + ## dbt-adapter 1.0.0 - April 01, 2024 ### Fixes diff --git a/dbt/adapters/__about__.py b/dbt/adapters/__about__.py index 11a716ec..2bc96277 100644 --- a/dbt/adapters/__about__.py +++ b/dbt/adapters/__about__.py @@ -1 +1 @@ -version = "1.0.0" +version = "1.0.8b3" From a7bbffcd4b67dbaf49fb5982cc015f6b6ca15741 Mon Sep 17 00:00:00 2001 From: Matthew McKnight <91097623+McKnight-42@users.noreply.github.com> Date: Tue, 16 Apr 2024 19:47:44 -0500 Subject: [PATCH 2/4] reverting release generated pr to fix 1.0.8 to correct 1.0.0b3 (#176) --- .changes/1.0.8-b3.md | 12 ------------ .../Features-20240323-160251.yaml | 0 .../Features-20240325-180611.yaml | 0 .../Features-20240409-084844.yaml | 0 .../Under the Hood-20240329-093307.yaml | 0 .../Under the Hood-20240410-184109.yaml | 0 CHANGELOG.md | 13 ------------- dbt/adapters/__about__.py | 2 +- 8 files changed, 1 insertion(+), 26 deletions(-) delete mode 100644 .changes/1.0.8-b3.md rename .changes/{1.0.8 => unreleased}/Features-20240323-160251.yaml (100%) rename .changes/{1.0.8 => unreleased}/Features-20240325-180611.yaml (100%) rename .changes/{1.0.8 => unreleased}/Features-20240409-084844.yaml (100%) rename .changes/{1.0.8 => unreleased}/Under the Hood-20240329-093307.yaml (100%) rename .changes/{1.0.8 => unreleased}/Under the Hood-20240410-184109.yaml (100%) diff --git a/.changes/1.0.8-b3.md b/.changes/1.0.8-b3.md deleted file mode 100644 index 4c613d15..00000000 --- a/.changes/1.0.8-b3.md +++ /dev/null @@ -1,12 +0,0 @@ -## dbt-adapter 1.0.8-b3 - April 16, 2024 - -### Features - -* Debug log when `type_code` fails to convert to a `data_type` -* Introduce TableLastModifiedMetadataBatch and implement BaseAdapter.calculate_freshness_from_metadata_batch -* Support for sql fixtures in unit testing - -### Under the Hood - -* Add the option to set the log level of the AdapterRegistered event -* Update dependabot config to cover GHA diff --git a/.changes/1.0.8/Features-20240323-160251.yaml b/.changes/unreleased/Features-20240323-160251.yaml similarity index 100% rename from .changes/1.0.8/Features-20240323-160251.yaml rename to .changes/unreleased/Features-20240323-160251.yaml diff --git a/.changes/1.0.8/Features-20240325-180611.yaml b/.changes/unreleased/Features-20240325-180611.yaml similarity index 100% rename from .changes/1.0.8/Features-20240325-180611.yaml rename to .changes/unreleased/Features-20240325-180611.yaml diff --git a/.changes/1.0.8/Features-20240409-084844.yaml b/.changes/unreleased/Features-20240409-084844.yaml similarity index 100% rename from .changes/1.0.8/Features-20240409-084844.yaml rename to .changes/unreleased/Features-20240409-084844.yaml diff --git a/.changes/1.0.8/Under the Hood-20240329-093307.yaml b/.changes/unreleased/Under the Hood-20240329-093307.yaml similarity index 100% rename from .changes/1.0.8/Under the Hood-20240329-093307.yaml rename to .changes/unreleased/Under the Hood-20240329-093307.yaml diff --git a/.changes/1.0.8/Under the Hood-20240410-184109.yaml b/.changes/unreleased/Under the Hood-20240410-184109.yaml similarity index 100% rename from .changes/1.0.8/Under the Hood-20240410-184109.yaml rename to .changes/unreleased/Under the Hood-20240410-184109.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 63dc2e36..9a024c80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,19 +5,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), and is generated by [Changie](https://github.com/miniscruff/changie). -## dbt-adapter 1.0.8-b3 - April 16, 2024 - -### Features - -* Debug log when `type_code` fails to convert to a `data_type` -* Introduce TableLastModifiedMetadataBatch and implement BaseAdapter.calculate_freshness_from_metadata_batch -* Support for sql fixtures in unit testing - -### Under the Hood - -* Add the option to set the log level of the AdapterRegistered event -* Update dependabot config to cover GHA - ## dbt-adapter 1.0.0 - April 01, 2024 ### Fixes diff --git a/dbt/adapters/__about__.py b/dbt/adapters/__about__.py index 2bc96277..11a716ec 100644 --- a/dbt/adapters/__about__.py +++ b/dbt/adapters/__about__.py @@ -1 +1 @@ -version = "1.0.8b3" +version = "1.0.0" From ca1974e8e0b8f99fd5dd69a99d9c9689455d7510 Mon Sep 17 00:00:00 2001 From: Github Build Bot Date: Wed, 17 Apr 2024 01:04:37 +0000 Subject: [PATCH 3/4] Bumping version to 1.1.0rc1 and generate changelog --- .changes/1.1.0-rc1.md | 12 ++++++++++++ .../Features-20240323-160251.yaml | 0 .../Features-20240325-180611.yaml | 0 .../Features-20240409-084844.yaml | 0 .../Under the Hood-20240329-093307.yaml | 0 .../Under the Hood-20240410-184109.yaml | 0 CHANGELOG.md | 13 +++++++++++++ dbt/adapters/__about__.py | 2 +- 8 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 .changes/1.1.0-rc1.md rename .changes/{unreleased => 1.1.0}/Features-20240323-160251.yaml (100%) rename .changes/{unreleased => 1.1.0}/Features-20240325-180611.yaml (100%) rename .changes/{unreleased => 1.1.0}/Features-20240409-084844.yaml (100%) rename .changes/{unreleased => 1.1.0}/Under the Hood-20240329-093307.yaml (100%) rename .changes/{unreleased => 1.1.0}/Under the Hood-20240410-184109.yaml (100%) diff --git a/.changes/1.1.0-rc1.md b/.changes/1.1.0-rc1.md new file mode 100644 index 00000000..8b47b109 --- /dev/null +++ b/.changes/1.1.0-rc1.md @@ -0,0 +1,12 @@ +## dbt-adapter 1.1.0-rc1 - April 17, 2024 + +### Features + +* Debug log when `type_code` fails to convert to a `data_type` +* Introduce TableLastModifiedMetadataBatch and implement BaseAdapter.calculate_freshness_from_metadata_batch +* Support for sql fixtures in unit testing + +### Under the Hood + +* Add the option to set the log level of the AdapterRegistered event +* Update dependabot config to cover GHA diff --git a/.changes/unreleased/Features-20240323-160251.yaml b/.changes/1.1.0/Features-20240323-160251.yaml similarity index 100% rename from .changes/unreleased/Features-20240323-160251.yaml rename to .changes/1.1.0/Features-20240323-160251.yaml diff --git a/.changes/unreleased/Features-20240325-180611.yaml b/.changes/1.1.0/Features-20240325-180611.yaml similarity index 100% rename from .changes/unreleased/Features-20240325-180611.yaml rename to .changes/1.1.0/Features-20240325-180611.yaml diff --git a/.changes/unreleased/Features-20240409-084844.yaml b/.changes/1.1.0/Features-20240409-084844.yaml similarity index 100% rename from .changes/unreleased/Features-20240409-084844.yaml rename to .changes/1.1.0/Features-20240409-084844.yaml diff --git a/.changes/unreleased/Under the Hood-20240329-093307.yaml b/.changes/1.1.0/Under the Hood-20240329-093307.yaml similarity index 100% rename from .changes/unreleased/Under the Hood-20240329-093307.yaml rename to .changes/1.1.0/Under the Hood-20240329-093307.yaml diff --git a/.changes/unreleased/Under the Hood-20240410-184109.yaml b/.changes/1.1.0/Under the Hood-20240410-184109.yaml similarity index 100% rename from .changes/unreleased/Under the Hood-20240410-184109.yaml rename to .changes/1.1.0/Under the Hood-20240410-184109.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a024c80..0af6f692 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), and is generated by [Changie](https://github.com/miniscruff/changie). +## dbt-adapter 1.1.0-rc1 - April 17, 2024 + +### Features + +* Debug log when `type_code` fails to convert to a `data_type` +* Introduce TableLastModifiedMetadataBatch and implement BaseAdapter.calculate_freshness_from_metadata_batch +* Support for sql fixtures in unit testing + +### Under the Hood + +* Add the option to set the log level of the AdapterRegistered event +* Update dependabot config to cover GHA + ## dbt-adapter 1.0.0 - April 01, 2024 ### Fixes diff --git a/dbt/adapters/__about__.py b/dbt/adapters/__about__.py index 11a716ec..d37cdcc7 100644 --- a/dbt/adapters/__about__.py +++ b/dbt/adapters/__about__.py @@ -1 +1 @@ -version = "1.0.0" +version = "1.1.0rc1" From 4774638f334908815ec685bb21877ac10ce200df Mon Sep 17 00:00:00 2001 From: Michelle Ark Date: Wed, 17 Apr 2024 16:41:18 -0400 Subject: [PATCH 4/4] [fix] use cast macro in default__get_empty_schema_sql (#165) --- .changes/unreleased/Fixes-20240411-185203.yaml | 6 ++++++ dbt/include/global_project/macros/adapters/columns.sql | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changes/unreleased/Fixes-20240411-185203.yaml diff --git a/.changes/unreleased/Fixes-20240411-185203.yaml b/.changes/unreleased/Fixes-20240411-185203.yaml new file mode 100644 index 00000000..5df91f93 --- /dev/null +++ b/.changes/unreleased/Fixes-20240411-185203.yaml @@ -0,0 +1,6 @@ +kind: Fixes +body: Fix adapter-specific cast handling for constraint enforcement +time: 2024-04-11T18:52:03.960202-07:00 +custom: + Author: michelleark + Issue: "166" diff --git a/dbt/include/global_project/macros/adapters/columns.sql b/dbt/include/global_project/macros/adapters/columns.sql index e1099649..663a827b 100644 --- a/dbt/include/global_project/macros/adapters/columns.sql +++ b/dbt/include/global_project/macros/adapters/columns.sql @@ -53,7 +53,7 @@ {%- do col_naked_numeric.append(col['name']) -%} {%- endif -%} {% set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] %} - cast(null as {{ col['data_type'] }}) as {{ col_name }}{{ ", " if not loop.last }} + {{ cast('null', col['data_type']) }} as {{ col_name }}{{ ", " if not loop.last }} {%- endfor -%} {%- if (col_err | length) > 0 -%} {{ exceptions.column_type_missing(column_names=col_err) }}