diff --git a/.changes/unreleased/Dependencies-20240320-111128.yaml b/.changes/unreleased/Dependencies-20240320-111128.yaml new file mode 100644 index 000000000..41f1609e4 --- /dev/null +++ b/.changes/unreleased/Dependencies-20240320-111128.yaml @@ -0,0 +1,6 @@ +kind: Dependencies +body: bump cryptography to 42.0.4 or higher for security callouts +time: 2024-03-20T11:11:28.5121-05:00 +custom: + Author: McKnight-42 + PR: "938" diff --git a/.changes/unreleased/Features-20240318-033136.yaml b/.changes/unreleased/Features-20240318-033136.yaml new file mode 100644 index 000000000..6176d094d --- /dev/null +++ b/.changes/unreleased/Features-20240318-033136.yaml @@ -0,0 +1,6 @@ +kind: Features +body: ' Add new workflow for internal patch releases' +time: 2024-03-18T03:31:36.425644-07:00 +custom: + Author: versusfacit + Issue: "38" diff --git a/.changes/unreleased/Fixes-20240320-154054.yaml b/.changes/unreleased/Fixes-20240320-154054.yaml new file mode 100644 index 000000000..6d74a2be9 --- /dev/null +++ b/.changes/unreleased/Fixes-20240320-154054.yaml @@ -0,0 +1,7 @@ +kind: Fixes +body: modify metadata queries to take into account object type of BASE TABLE being + assigned to dynamic tables when was null previously +time: 2024-03-20T15:40:54.074292-05:00 +custom: + Author: McKnight-42 + Issue: "934" diff --git a/.github/workflows/release-internal.yml b/.github/workflows/release-internal.yml new file mode 100644 index 000000000..dc12e3781 --- /dev/null +++ b/.github/workflows/release-internal.yml @@ -0,0 +1,64 @@ +name: Release internal patch + +on: + workflow_dispatch: + inputs: + version_number: + description: "The release version number (i.e. 1.0.0b1)" + type: string + required: true + sha: + description: "The sha to use (leave empty to use latest on main)" + type: string + required: false + package_test_command: + description: "Package test command" + type: string + default: "python -c \"import dbt.adapters.snowflake\"" + required: true + dbms_name: + description: "The name of the warehouse the adapter connects to." + type: string + default: "snowflake" + required: true + workflow_call: + inputs: + version_number: + description: "The release version number (i.e. 1.0.0b1)" + type: string + required: true + sha: + description: "The sha to use (leave empty to use latest on main)" + type: string + required: false + package_test_command: + description: "Package test command" + type: string + default: "python -c \"import dbt.adapters.snowflake\"" + required: true + dbms_name: + description: "The name of the warehouse the adapter connects to." + type: string + default: "snowflake" + required: true + +defaults: + run: + shell: bash + +env: + PYTHON_TARGET_VERSION: 3.11 + +jobs: + invoke-reusable-workflow: + name: Build and Release Internally + + uses: VersusFacit/dbt-release/.github/workflows/internal-archive-release.yml@main + + with: + version_number: ${{ inputs.version_number }} + package_test_command: ${{ inputs.package_test_command }} + dbms_name: ${{ inputs.dbms_name }} + sha: ${{ inputs.sha }} + + secrets: inherit diff --git a/dbt/include/snowflake/macros/catalog.sql b/dbt/include/snowflake/macros/catalog.sql index f0c766865..8354d3c44 100644 --- a/dbt/include/snowflake/macros/catalog.sql +++ b/dbt/include/snowflake/macros/catalog.sql @@ -41,7 +41,10 @@ table_catalog as "table_database", table_schema as "table_schema", table_name as "table_name", - coalesce(table_type, 'DYNAMIC TABLE') as "table_type", + case + when is_dynamic = 'YES' and table_type = 'BASE TABLE' THEN 'DYNAMIC TABLE' + else table_type + end as "table_type", comment as "table_comment", -- note: this is the _role_ that owns the table diff --git a/dev-requirements.txt b/dev-requirements.txt index 09e85d06d..5e5458901 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -9,7 +9,7 @@ git+https://github.com/dbt-labs/dbt-adapters.git#subdirectory=dbt-tests-adapter black~=23.12 bumpversion~=0.6.0 click~=8.1 -cryptography~=41.0.7 +cryptography~=42.0.4 ddtrace==2.3.0 flake8~=6.1 flaky~=3.7 diff --git a/tests/functional/adapter/dynamic_table_tests/utils.py b/tests/functional/adapter/dynamic_table_tests/utils.py index 1f145ec04..5763e1b6c 100644 --- a/tests/functional/adapter/dynamic_table_tests/utils.py +++ b/tests/functional/adapter/dynamic_table_tests/utils.py @@ -11,10 +11,10 @@ def query_relation_type(project, relation: SnowflakeRelation) -> Optional[str]: sql = f""" select case + when table_type = 'BASE TABLE' and is_dynamic = 'YES' then 'dynamic_table' when table_type = 'BASE TABLE' then 'table' when table_type = 'VIEW' then 'view' when table_type = 'EXTERNAL TABLE' then 'external_table' - when table_type is null then 'dynamic_table' end as relation_type from information_schema.tables where table_name like '{relation.identifier.upper()}'