Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/main' into dependab…
Browse files Browse the repository at this point in the history
…ot/github_actions/actions/setup-python-5
  • Loading branch information
mikealfare committed Apr 25, 2024
2 parents ca59b8e + d10e940 commit dd4fd53
Show file tree
Hide file tree
Showing 33 changed files with 394 additions and 202 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.8.0b2
current_version = 1.8.0b3
parse = (?P<major>[\d]+) # major version number
\.(?P<minor>[\d]+) # minor version number
\.(?P<patch>[\d]+) # patch version number
Expand Down
17 changes: 17 additions & 0 deletions .changes/1.8.0-b3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## dbt-snowflake 1.8.0-b3 - April 17, 2024

### Features

- Add external_access_integration and secret to python models ([#955](https://github.com/dbt-labs/dbt-snowflake/issues/955))
- Support TableLastModifiedMetadataBatch capability ([#965](https://github.com/dbt-labs/dbt-snowflake/issues/965))

### Fixes

- skipping a test that provides a false condition ([#976](https://github.com/dbt-labs/dbt-snowflake/issues/976))

### Under the Hood

- Update dependabot to cover GHA ([#967](https://github.com/dbt-labs/dbt-snowflake/issues/967))

### Contributors
- [@Lindblomsebastian](https://github.com/Lindblomsebastian) ([#955](https://github.com/dbt-labs/dbt-snowflake/issues/955))
6 changes: 6 additions & 0 deletions .changes/1.8.0/Features-20240404-171704.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Features
body: Support TableLastModifiedMetadataBatch capability
time: 2024-04-04T17:17:04.853047-07:00
custom:
Author: michelleark
Issue: "965"
6 changes: 6 additions & 0 deletions .changes/1.8.0/Fixes-20240416-203625.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: skipping a test that provides a false condition
time: 2024-04-16T20:36:25.449409-05:00
custom:
Author: McKnight-42
Issue: "976"
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20240412-094507.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: 'test contract enforcement for GEOGRAPHY and GEOMETRY types '
time: 2024-04-12T09:45:07.55962-07:00
custom:
Author: michelleark
Issue: "894"
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20240418-160240.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Fix duplicate alias being added when running a model with inline refs and `--empty`
time: 2024-04-18T16:02:40.488967-07:00
custom:
Author: colin-rogers-dbt
Issue: "980"
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ updates:
schedule:
interval: "weekly"
rebase-strategy: "disabled"
- package-ecosystem: "docker"
directory: "/docker"
schedule:
interval: "weekly"
rebase-strategy: "disabled"
4 changes: 2 additions & 2 deletions .github/scripts/integration-test-matrix.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module.exports = ({ context }) => {

if (labels.includes("test macos") || testAllLabel) {
include.push({
os: "macos-latest",
os: "macos-12",
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-latest"]) {
for (const operatingSystem of ["windows-latest", "macos-12"]) {
include.push({
os: operatingSystem,
adapter: adapter,
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, macos-12, windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']

steps:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/nightly-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ on:

permissions:
contents: write # this is the permission that allows creating a new release
packages: write # this is the permission that allows pushing Docker images

defaults:
run:
Expand Down
54 changes: 28 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
#
# **when?**
# This workflow can be run manually on demand or can be called by other workflows
name: Release to GitHub and PyPI
name: "Release to GitHub, PyPI, and Docker"
run-name: "Release ${{ inputs.version_number }} to GitHub, PyPI, and Docker"

on:
workflow_dispatch:
Expand Down Expand Up @@ -60,6 +61,11 @@ on:
type: boolean
default: false
required: false
only_docker:
description: "Only release Docker image, skip GitHub & PyPI"
type: boolean
default: false
required: false
workflow_call:
inputs:
sha:
Expand Down Expand Up @@ -128,30 +134,25 @@ jobs:
echo Package test command: ${{ inputs.package_test_command }}
echo Test run: ${{ inputs.test_run }}
echo Nightly release: ${{ inputs.nightly_release }}
echo Only Docker: ${{ inputs.only_docker }}
bump-version-generate-changelog:
name: Bump package version, Generate changelog

uses: dbt-labs/dbt-release/.github/workflows/release-prep.yml@main

with:
sha: ${{ inputs.sha }}
version_number: ${{ inputs.version_number }}
target_branch: ${{ inputs.target_branch }}
env_setup_script_path: ${{ inputs.env_setup_script_path }}
test_run: ${{ inputs.test_run }}
nightly_release: ${{ inputs.nightly_release }}

secrets: inherit

log-outputs-bump-version-generate-changelog:
name: "[Log output] Bump package version, Generate changelog"
if: ${{ !failure() && !cancelled() }}

if: ${{ !failure() && !cancelled() && !inputs.only_docker }}
needs: [bump-version-generate-changelog]

runs-on: ubuntu-latest

steps:
- name: Print variables
run: |
Expand All @@ -160,11 +161,9 @@ jobs:
build-test-package:
name: Build, Test, Package
if: ${{ !failure() && !cancelled() }}
if: ${{ !failure() && !cancelled() && !inputs.only_docker }}
needs: [bump-version-generate-changelog]

uses: dbt-labs/dbt-release/.github/workflows/build.yml@main

with:
sha: ${{ needs.bump-version-generate-changelog.outputs.final_sha }}
version_number: ${{ inputs.version_number }}
Expand All @@ -174,19 +173,15 @@ jobs:
package_test_command: ${{ inputs.package_test_command }}
test_run: ${{ inputs.test_run }}
nightly_release: ${{ inputs.nightly_release }}

secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

github-release:
name: GitHub Release
if: ${{ !failure() && !cancelled() }}

if: ${{ !failure() && !cancelled() && !inputs.only_docker }}
needs: [bump-version-generate-changelog, build-test-package]

uses: dbt-labs/dbt-release/.github/workflows/github-release.yml@main

with:
sha: ${{ needs.bump-version-generate-changelog.outputs.final_sha }}
version_number: ${{ inputs.version_number }}
Expand All @@ -195,34 +190,41 @@ jobs:

pypi-release:
name: PyPI Release

needs: [github-release]

if: ${{ !failure() && !cancelled() && !inputs.only_docker }}
needs: [bump-version-generate-changelog, build-test-package]
uses: dbt-labs/dbt-release/.github/workflows/pypi-release.yml@main

with:
version_number: ${{ inputs.version_number }}
test_run: ${{ inputs.test_run }}

secrets:
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
TEST_PYPI_API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}

docker-release:
name: "Docker Release"
# We cannot release to docker on a test run because it uses the tag in GitHub as
# what we need to release but draft releases don't actually tag the commit so it
# finds nothing to release
if: ${{ !failure() && !cancelled() && (!inputs.test_run || inputs.only_docker) }}
needs: [bump-version-generate-changelog, build-test-package, github-release]
permissions:
packages: write
uses: dbt-labs/dbt-release/.github/workflows/release-docker.yml@main
with:
version_number: ${{ inputs.version_number }}
test_run: ${{ inputs.test_run }}

slack-notification:
name: Slack Notification
if: ${{ failure() && (!inputs.test_run || inputs.nightly_release) }}

needs:
[
bump-version-generate-changelog,
build-test-package,
github-release,
pypi-release,
docker-release,
]

uses: dbt-labs/dbt-release/.github/workflows/slack-post-notification.yml@main
with:
status: "failure"

secrets:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_DEV_ADAPTER_ALERTS }}
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-case-conflict
- repo: https://github.com/dbt-labs/pre-commit-hooks
rev: v0.1.0a1
hooks:
- id: dbt-core-in-adapters-check
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
Expand Down
21 changes: 19 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@
- "Breaking changes" listed under a version may require action from end users or external maintainers when upgrading to that version.
- Do not edit this file directly. This file is auto-generated using [changie](https://github.com/miniscruff/changie). For details on how to document a change, see [the contributing guide](https://github.com/dbt-labs/dbt-snowflake/blob/main/CONTRIBUTING.md#adding-changelog-entry)

## dbt-snowflake 1.8.0-b3 - April 17, 2024

### Features

- Add external_access_integration and secret to python models ([#955](https://github.com/dbt-labs/dbt-snowflake/issues/955))
- Support TableLastModifiedMetadataBatch capability ([#965](https://github.com/dbt-labs/dbt-snowflake/issues/965))

### Fixes

- skipping a test that provides a false condition ([#976](https://github.com/dbt-labs/dbt-snowflake/issues/976))

### Under the Hood

- Update dependabot to cover GHA ([#967](https://github.com/dbt-labs/dbt-snowflake/issues/967))

### Contributors
- [@Lindblomsebastian](https://github.com/Lindblomsebastian) ([#955](https://github.com/dbt-labs/dbt-snowflake/issues/955))


## dbt-snowflake 1.8.0-b2 - April 03, 2024

### Features
Expand All @@ -31,8 +50,6 @@

- Pin `black>=24.3` in `dev-requirements.txt` ([#959](https://github.com/dbt-labs/dbt-snowflake/pull/959))



## dbt-snowflake 1.8.0-b1 - March 02, 2024

### Features
Expand Down
37 changes: 8 additions & 29 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,32 +66,11 @@ help: ## Show this help message.
@echo 'targets:'
@grep -E '^[7+a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

.PHONY: ubuntu-py38
ubuntu-py38:
docker build -f docker_dev/ubuntu.Dockerfile -t dbt-snowflake-ubuntu-py38 . --build-arg version=3.8
docker run --rm -it --name dbt-snowflake-ubuntu-py38 -v $(shell pwd):/opt/code dbt-snowflake-ubuntu-py38

.PHONY: ubuntu-py39
ubuntu-py39:
docker build -f docker_dev/ubuntu.Dockerfile -t dbt-snowflake-ubuntu-py39 . --build-arg version=3.9
docker run --rm -it --name dbt-snowflake-ubuntu-py39 -v $(shell pwd):/opt/code dbt-snowflake-ubuntu-py39

.PHONY: ubuntu-py310
ubuntu-py310:
docker build -f docker_dev/ubuntu.Dockerfile -t dbt-snowflake-ubuntu-py310 . --build-arg version=3.10
docker run --rm -it --name dbt-snowflake-ubuntu-py310 -v $(shell pwd):/opt/code dbt-snowflake-ubuntu-py310

.PHONY: ubuntu-py311
ubuntu-py311:
docker build -f docker_dev/ubuntu.Dockerfile -t dbt-snowflake-ubuntu-py311 . --build-arg version=3.11
docker run --rm -it --name dbt-snowflake-ubuntu-py311 -v $(shell pwd):/opt/code dbt-snowflake-ubuntu-py311

.PHONY: debian-py38
debian-py38:
docker build -f docker/debian-py38.Dockerfile -t dbt-snowflake-debian-py38 . --build-arg version=3.8.15
docker run --rm -it --name dbt-snowflake-debian-py38 -v $(shell pwd):/opt/code dbt-snowflake-debian-py38

.PHONY: dev-env-default
dev-env-default:
docker build -f docker/dev-env-default.Dockerfile -t dbt-snowflake-dev-env-default .
docker run --rm -it --name dbt-snowflake-dev-env-default -v $(shell pwd):/opt/code dbt-snowflake-dev-env-default
.PHONY: docker-dev
docker-dev:
docker build -f docker/dev.Dockerfile -t dbt-snowflake-dev .
docker run --rm -it --name dbt-snowflake-dev -v $(shell pwd):/opt/code dbt-snowflake-dev

.PHONY: docker-prod
docker-prod:
docker build -f docker/Dockerfile -t dbt-snowflake .
2 changes: 1 addition & 1 deletion dbt/adapters/snowflake/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "1.8.0b2"
version = "1.8.0b3"
1 change: 1 addition & 0 deletions dbt/adapters/snowflake/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class SnowflakeAdapter(SQLAdapter):
{
Capability.SchemaMetadataByRelations: CapabilitySupport(support=Support.Full),
Capability.TableLastModifiedMetadata: CapabilitySupport(support=Support.Full),
Capability.TableLastModifiedMetadataBatch: CapabilitySupport(support=Support.Full),
}
)

Expand Down
2 changes: 1 addition & 1 deletion dbt/adapters/snowflake/relation.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
class SnowflakeRelation(BaseRelation):
type: Optional[SnowflakeRelationType] = None # type: ignore
quote_policy: SnowflakeQuotePolicy = field(default_factory=lambda: SnowflakeQuotePolicy())

require_alias: bool = False
renameable_relations: FrozenSet[SnowflakeRelationType] = field(
default_factory=lambda: frozenset(
{
Expand Down
37 changes: 37 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# this image gets published to GHCR for production use
ARG py_version=3.11.2

FROM python:$py_version-slim-bullseye as base

RUN apt-get update \
&& apt-get dist-upgrade -y \
&& apt-get install -y --no-install-recommends \
build-essential=12.9 \
ca-certificates=20210119 \
git=1:2.30.2-1+deb11u2 \
libpq-dev=13.14-0+deb11u1 \
make=4.3-4.1 \
openssh-client=1:8.4p1-5+deb11u3 \
software-properties-common=0.96.20.2-2.1 \
&& apt-get clean \
&& rm -rf \
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/*

ENV PYTHONIOENCODING=utf-8
ENV LANG=C.UTF-8

RUN python -m pip install --upgrade "pip==24.0" "setuptools==69.2.0" "wheel==0.43.0" --no-cache-dir


FROM base as dbt-snowflake

ARG commit_ref=main

HEALTHCHECK CMD dbt --version || exit 1

WORKDIR /usr/app/dbt/
ENTRYPOINT ["dbt"]

RUN python -m pip install --no-cache-dir "dbt-snowflake @ git+https://github.com/dbt-labs/dbt-snowflake@${commit_ref}"
Loading

0 comments on commit dd4fd53

Please sign in to comment.