Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/pip/pytest-approx-eq-8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
mikealfare authored Nov 9, 2024
2 parents 1dd5f7d + 01dbd70 commit 5fa466f
Show file tree
Hide file tree
Showing 102 changed files with 2,234 additions and 802 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.9.0a1
current_version = 1.9.0b1
parse = (?P<major>[\d]+) # major version number
\.(?P<minor>[\d]+) # minor version number
\.(?P<patch>[\d]+) # patch version number
Expand Down
61 changes: 61 additions & 0 deletions .changes/1.9.0-b1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
## dbt-snowflake 1.9.0-b1 - October 01, 2024

### Features

- Support refresh_mode and initialize parameters for dynamic tables ([#1076](https://github.com/dbt-labs/dbt-snowflake/issues/1076))
- Add tests for cross-database `cast` macro ([#1009](https://github.com/dbt-labs/dbt-snowflake/issues/1009))
- Cross-database `date` macro ([#1013](https://github.com/dbt-labs/dbt-snowflake/issues/1013))
- Replace underscores with hyphens in account IDs to prevent SSL issues ([#1068](https://github.com/dbt-labs/dbt-snowflake/issues/1068))
- Support JWT Authentication ([#1079](https://github.com/dbt-labs/dbt-snowflake/issues/1079), [#726](https://github.com/dbt-labs/dbt-snowflake/issues/726))
- Improve run times for large projects by reusing connections by default ([#1082](https://github.com/dbt-labs/dbt-snowflake/issues/1082))
- Improve run times when using key pair auth by caching the private key ([#1082](https://github.com/dbt-labs/dbt-snowflake/issues/1082))
- Add support for Iceberg table materializations. ([#321](https://github.com/dbt-labs/dbt-snowflake/issues/321))
- Microbatch incremental strategy ([#1182](https://github.com/dbt-labs/dbt-snowflake/issues/1182))
- Add support for Iceberg table format in Dynamic Tables ([#1183](https://github.com/dbt-labs/dbt-snowflake/issues/1183))
- Add Iceberg format Incremental Models ([#321](https://github.com/dbt-labs/dbt-snowflake/issues/321))
- Add support for all on_schema_change incremental model strategies. ([#321](https://github.com/dbt-labs/dbt-snowflake/issues/321))

### Fixes

- Get catalog metadata for a single relation in the most optimized way using the get_catalog_for_single_relation macro and capability ([#1048](https://github.com/dbt-labs/dbt-snowflake/issues/1048))
- Update relation caching to correctly identify dynamic tables, accounting for Snowflake's `2024_03` bundle ([#1016](https://github.com/dbt-labs/dbt-snowflake/issues/1016))
- Rename targets for tables and views use fully qualified names ([#1031](https://github.com/dbt-labs/dbt-snowflake/issues/1031))
- Surface SSO token expiration in logs ([#851](https://github.com/dbt-labs/dbt-snowflake/issues/851))
- return to previous naming convention to return to quoting policy ([#1074](https://github.com/dbt-labs/dbt-snowflake/issues/1074))
- Fix scenario where using the `--empty` flag causes metadata queries to contain limit clauses ([#1033](https://github.com/dbt-labs/dbt-snowflake/issues/1033))
- Use show ... starts with instead of show ... like in _show_object_metadata ([#1102](https://github.com/dbt-labs/dbt-snowflake/issues/1102))
- Fix issue where dbt-snowflake attempts to drop database roles during grants sync ([#1151](https://github.com/dbt-labs/dbt-snowflake/issues/1151))

### Under the Hood

- Lazy load agate ([#953](https://github.com/dbt-labs/dbt-snowflake/issues/953))
- Speedup catalog string comparison by using ilike before equals ([#1035](https://github.com/dbt-labs/dbt-snowflake/issues/1035))
- Improve memory efficiency of the process_results() override. ([#1053](https://github.com/dbt-labs/dbt-snowflake/issues/1053))
- Automate all manual integration tests for Dynamic Tables ([#1084](https://github.com/dbt-labs/dbt-snowflake/issues/1084))
- Add support for experimental record/replay testing. ([#1106](https://github.com/dbt-labs/dbt-snowflake/issues/1106))
- Remove `freezegun` as a testing dependency; this package is no longer used ([#1136](https://github.com/dbt-labs/dbt-snowflake/issues/1136))
- Add support for Python 3.12 ([#903](https://github.com/dbt-labs/dbt-snowflake/issues/903))
- Isolating distribution testing ([#1130](https://github.com/dbt-labs/dbt-snowflake/issues/1130))
- Change behavior flag semantics to log iceberg flag warnings.. ([#321](https://github.com/dbt-labs/dbt-snowflake/issues/321))

### Dependencies

- Update freezegun requirement from ~=1.3 to ~=1.4 ([#869](https://github.com/dbt-labs/dbt-snowflake/pull/869))
- Bump actions/upload-artifact from 3 to 4 ([#971](https://github.com/dbt-labs/dbt-snowflake/pull/971))
- Bump dbt-labs/actions from 1.1.0 to 1.1.1 ([#1006](https://github.com/dbt-labs/dbt-snowflake/pull/1006))
- Bump actions/download-artifact from 3 to 4 ([#1007](https://github.com/dbt-labs/dbt-snowflake/pull/1007))
- Bump aurelien-baudet/workflow-dispatch from 2 to 4 ([#1093](https://github.com/dbt-labs/dbt-snowflake/pull/1093))
- Update twine requirement from ~=4.0 to ~=5.1 ([#1120](https://github.com/dbt-labs/dbt-snowflake/pull/1120))
- Bump pre-commit from 3.7.0 to 3.7.1 ([#1119](https://github.com/dbt-labs/dbt-snowflake/pull/1119))
- Update wheel requirement from ~=0.42 to ~=0.43 ([#1121](https://github.com/dbt-labs/dbt-snowflake/pull/1121))
- Update pytest-xdist requirement from ~=3.5 to ~=3.6 ([#1122](https://github.com/dbt-labs/dbt-snowflake/pull/1122))
- Update tox requirement from ~=4.11 to ~=4.16 ([#1135](https://github.com/dbt-labs/dbt-snowflake/pull/1135))

### Contributors
- [@HenkvanDyk,mikealfare](https://github.com/HenkvanDyk,mikealfare) ([#1076](https://github.com/dbt-labs/dbt-snowflake/issues/1076))
- [@McKnight-42](https://github.com/McKnight-42) ([#851](https://github.com/dbt-labs/dbt-snowflake/issues/851), [#1074](https://github.com/dbt-labs/dbt-snowflake/issues/1074))
- [@amardatar](https://github.com/amardatar) ([#1082](https://github.com/dbt-labs/dbt-snowflake/issues/1082))
- [@dwreeves](https://github.com/dwreeves) ([#953](https://github.com/dbt-labs/dbt-snowflake/issues/953))
- [@leahwicz](https://github.com/leahwicz) ([#1130](https://github.com/dbt-labs/dbt-snowflake/issues/1130))
- [@llam15](https://github.com/llam15) ([#1079](https://github.com/dbt-labs/dbt-snowflake/issues/1079), [#726](https://github.com/dbt-labs/dbt-snowflake/issues/726))
- [@mikealfare,](https://github.com/mikealfare,) ([#851](https://github.com/dbt-labs/dbt-snowflake/issues/851))
6 changes: 6 additions & 0 deletions .changes/1.9.0/Features-20240911-001806.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Features
body: Add support for Iceberg table materializations.
time: 2024-09-11T00:18:06.780586-07:00
custom:
Author: versusfacit
Issue: "321"
6 changes: 6 additions & 0 deletions .changes/1.9.0/Features-20240913-215416.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Features
body: Microbatch incremental strategy
time: 2024-09-13T21:54:16.492885-04:00
custom:
Author: michelleark
Issue: "1182"
6 changes: 6 additions & 0 deletions .changes/1.9.0/Features-20240917-100505.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Features
body: Add support for Iceberg table format in Dynamic Tables
time: 2024-09-17T10:05:05.609859-04:00
custom:
Author: mikealfare
Issue: "1183"
6 changes: 6 additions & 0 deletions .changes/1.9.0/Features-20240923-203204.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Features
body: Add Iceberg format Incremental Models
time: 2024-09-23T20:32:04.783741-07:00
custom:
Author: versusfacit
Issue: "321"
6 changes: 6 additions & 0 deletions .changes/1.9.0/Features-20240930-112041.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Features
body: Add support for all on_schema_change incremental model strategies.
time: 2024-09-30T11:20:41.99589-07:00
custom:
Author: versusfacit
Issue: "321"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions .changes/1.9.0/Fixes-20240920-193613.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Fix issue where dbt-snowflake attempts to drop database roles during grants sync
time: 2024-09-20T19:36:13.671173-04:00
custom:
Author: mikealfare
Issue: "1151"
6 changes: 6 additions & 0 deletions .changes/1.9.0/Under the Hood-20240806-215935.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Under the Hood
body: Isolating distribution testing
time: 2024-08-06T21:59:35.284641-04:00
custom:
Author: leahwicz
Issue: "1130"
6 changes: 6 additions & 0 deletions .changes/1.9.0/Under the Hood-20240917-181147.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Under the Hood
body: Change behavior flag semantics to log iceberg flag warnings..
time: 2024-09-17T18:11:47.525026-07:00
custom:
Author: versusfacit
Issue: "321"
6 changes: 6 additions & 0 deletions .changes/unreleased/Breaking Changes-20241016-183143.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Breaking Changes
body: Drop support for Python 3.8
time: 2024-10-16T18:31:43.4167-04:00
custom:
Author: mikealfare
Issue: "1211"
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20241008-122635.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Dynamic Iceberg table base_location_subpath generation fix.
time: 2024-10-08T12:26:35.521308-07:00
custom:
Author: versusfacit
Issue: "1200"
7 changes: 7 additions & 0 deletions .changes/unreleased/Fixes-20241104-104610.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
kind: Fixes
body: 'Performance fixes for snowflake microbatch strategy: use temp view instead
of table, remove unnecessary ''using'' clause'
time: 2024-11-04T10:46:10.005317-05:00
custom:
Author: michelleark
Issue: "1228"
6 changes: 6 additions & 0 deletions .changes/unreleased/Under the Hood-20241016-035544.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Under the Hood
body: Add telemetry function
time: 2024-10-16T03:55:44.144174-07:00
custom:
Author: versusfacit
Issue: "301"
6 changes: 6 additions & 0 deletions .changes/unreleased/Under the Hood-20241106-113249.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Under the Hood
body: remove SnowflakeAdapterResponse in favor of updated AdapterResponse in base
time: 2024-11-06T11:32:49.503467-08:00
custom:
Author: colin-rogers-dbt
Issue: "1233"
8 changes: 4 additions & 4 deletions .github/scripts/integration-test-matrix.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = ({ context }) => {
const defaultPythonVersion = "3.8";
const supportedPythonVersions = ["3.8", "3.9", "3.10", "3.11", "3.12"];
const defaultPythonVersion = "3.9";
const supportedPythonVersions = ["3.9", "3.10", "3.11", "3.12"];
const supportedAdapters = ["snowflake"];

// if PR, generate matrix based on files changed and PR labels
Expand Down Expand Up @@ -44,7 +44,7 @@ module.exports = ({ context }) => {

if (labels.includes("test macos") || testAllLabel) {
include.push({
os: "macos-12",
os: "macos-14",
adapter,
"python-version": pythonVersion,
});
Expand Down Expand Up @@ -78,7 +78,7 @@ module.exports = ({ context }) => {
// additionally include runs for all adapters, on macos and windows,
// but only for the default python version
for (const adapter of supportedAdapters) {
for (const operatingSystem of ["windows-latest", "macos-12"]) {
for (const operatingSystem of ["windows-latest", "macos-14"]) {
include.push({
os: operatingSystem,
adapter: adapter,
Expand Down
20 changes: 0 additions & 20 deletions .github/scripts/update_dbt_core_branch.sh

This file was deleted.

21 changes: 21 additions & 0 deletions .github/scripts/update_dev_dependency_branches.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash -e
set -e


dbt_adapters_branch=$1
dbt_core_branch=$2
dbt_common_branch=$3
target_req_file="dev-requirements.txt"
core_req_sed_pattern="s|dbt-core.git.*#egg=dbt-core|dbt-core.git@${dbt_core_branch}#egg=dbt-core|g"
adapters_req_sed_pattern="s|dbt-adapters.git|dbt-adapters.git@${dbt_adapters_branch}|g"
common_req_sed_pattern="s|dbt-common.git|dbt-common.git@${dbt_common_branch}|g"
if [[ "$OSTYPE" == darwin* ]]; then
# mac ships with a different version of sed that requires a delimiter arg
sed -i "" "$adapters_req_sed_pattern" $target_req_file
sed -i "" "$core_req_sed_pattern" $target_req_file
sed -i "" "$common_req_sed_pattern" $target_req_file
else
sed -i "$adapters_req_sed_pattern" $target_req_file
sed -i "$core_req_sed_pattern" $target_req_file
sed -i "$common_req_sed_pattern" $target_req_file
fi
53 changes: 43 additions & 10 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

name: Adapter Integration Tests

run-name: "${{ (contains(github.event_name, 'workflow_') && inputs.name) || github.event_name }}: ${{ (contains(github.event_name, 'workflow_') && inputs.adapter_branch) || github.ref_name }} by @${{ github.actor }}"

on:
# pushes to release branches
push:
Expand All @@ -34,10 +36,31 @@ on:
# manual trigger
workflow_dispatch:
inputs:
dbt-core-branch:
description: "branch of dbt-core to use in dev-requirements.txt"
name:
description: "Name to associate with run (example: 'dbt-adapters-242')"
required: false
type: string
default: "Adapter Integration Tests"
adapter_branch:
description: "The branch of this adapter repository to use"
type: string
required: false
default: "main"
dbt_adapters_branch:
description: "The branch of dbt-adapters to use"
type: string
required: false
default: "main"
dbt_core_branch:
description: "The branch of dbt-core to use"
type: string
required: false
default: "main"
dbt_common_branch:
description: "The branch of dbt-common to use"
type: string
required: false
default: "main"

# explicitly turn off permissions for `GITHUB_TOKEN`
permissions: read-all
Expand Down Expand Up @@ -141,12 +164,19 @@ jobs:

steps:
- name: Check out the repository
if: github.event_name != 'pull_request_target'
if: github.event_name == 'push'
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Check out the repository (workflow_dispatch)
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v4
with:
persist-credentials: false
ref: ${{ inputs.adapter_branch }}

# explicity checkout the branch for the PR,
# explicitly checkout the branch for the PR,
# this is necessary for the `pull_request_target` event
- name: Check out the repository (PR)
if: github.event_name == 'pull_request_target'
Expand All @@ -160,19 +190,22 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Update Adapters and Core branches (update dev_requirements.txt)
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
./.github/scripts/update_dev_dependency_branches.sh \
${{ inputs.dbt_adapters_branch }} \
${{ inputs.dbt_core_branch }} \
${{ inputs.dbt_common_branch }}
cat dev-requirements.txt
- name: Install python dependencies
run: |
python -m pip install --user --upgrade pip
python -m pip install tox
python -m pip --version
tox --version
- name: Update dev_requirements.txt
if: inputs.dbt-core-branch != ''
run: |
pip install bumpversion
./.github/scripts/update_dbt_core_branch.sh ${{ inputs.dbt-core-branch }}
- name: Run tox (snowflake)
if: matrix.adapter == 'snowflake'
env:
Expand Down
27 changes: 10 additions & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: '3.9'

- name: Install python dependencies
run: |
Expand All @@ -71,7 +71,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.9', '3.10', '3.11', '3.12']

env:
TOXENV: "unit"
Expand Down Expand Up @@ -127,7 +127,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: '3.9'

- name: Install python dependencies
run: |
Expand Down Expand Up @@ -163,7 +163,7 @@ jobs:
overwrite: true

test-build:
name: verify packages / python ${{ matrix.python-version }} / ${{ matrix.os }}
name: verify packages / python ${{ matrix.python-version }} / ${{ matrix.os }} / ${{ matrix.dist-type }}

if: needs.build.outputs.is_alpha == 0

Expand All @@ -174,8 +174,9 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-12, windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest, macos-14, windows-latest]
python-version: ['3.9', '3.10', '3.11', '3.12']
dist-type: ['whl', 'gz']

steps:
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -197,18 +198,10 @@ jobs:
- name: Show distributions
run: ls -lh dist/

- name: Install wheel distributions
- name: Install ${{ matrix.dist-type }} distributions
run: |
find ./dist/*.whl -maxdepth 1 -type f | xargs python -m pip install --force-reinstall --find-links=dist/
find ./dist/*.${{ matrix.dist-type }} -maxdepth 1 -type f | xargs python -m pip install --force-reinstall --find-links=dist/
- name: Check wheel distributions
run: |
python -c "import dbt.adapters.snowflake"
- name: Install source distributions
run: |
find ./dist/*.gz -maxdepth 1 -type f | xargs python -m pip install --force-reinstall --find-links=dist/
- name: Check source distributions
- name: Check ${{ matrix.dist-type }} distributions
run: |
python -c "import dbt.adapters.snowflake"
Loading

0 comments on commit 5fa466f

Please sign in to comment.