Skip to content

Commit 7acbfc8

Browse files
authored
Merge branch 'main' into dbeatty/snapshots_new_record_mode
2 parents 0fd3114 + 9e6516a commit 7acbfc8

27 files changed

+960
-510
lines changed

.bumpversion.cfg

Lines changed: 0 additions & 35 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
kind: Features
2+
body: Add IdpTokenAuthPlugin authentication method.
3+
time: 2024-12-17T18:13:40.281494-08:00
4+
custom:
5+
Author: versusfacit
6+
Issue: "898"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
kind: Under the Hood
2+
body: Add retry logic for retryable exceptions
3+
time: 2024-12-04T18:57:29.925299-08:00
4+
custom:
5+
Author: versusfacit colin-rogers-dbt
6+
Issue: "960"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
kind: Under the Hood
2+
body: Move from setup.py to pyproject.toml and to hatch as a dev tool
3+
time: 2024-12-07T16:59:18.731819-05:00
4+
custom:
5+
Author: mikealfare
6+
Issue: "951"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
kind: Under the Hood
2+
body: Refactor to use new batch context varaibles
3+
time: 2024-12-11T14:51:32.239224-06:00
4+
custom:
5+
Author: QMalcolm
6+
Issue: "966"

.github/scripts/update_dependencies.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
set -e
33

44
git_branch=$1
5-
target_req_file="dev-requirements.txt"
6-
core_req_sed_pattern="s|dbt-core.git.*#egg=dbt-core|dbt-core.git@${git_branch}#egg=dbt-core|g"
7-
postgres_req_sed_pattern="s|dbt-core.git.*#egg=dbt-postgres|dbt-core.git@${git_branch}#egg=dbt-postgres|g"
8-
tests_req_sed_pattern="s|dbt-core.git.*#egg=dbt-tests|dbt-core.git@${git_branch}#egg=dbt-tests|g"
5+
target_req_file="hatch.toml"
6+
core_req_sed_pattern="s|dbt-core.git.*#subdirectory=core|dbt-core.git@${git_branch}#subdirectory=core|g"
7+
postgres_req_sed_pattern="s|dbt-postgres.git|dbt-postgres.git@${git_branch}"
8+
tests_req_sed_pattern="s|dbt-adapters.git.*#subdirectory=dbt-tests-adapter|dbt-adapters.git@${git_branch}#subdirectory=dbt-tests-adapter|g"
99
if [[ "$OSTYPE" == darwin* ]]; then
1010
# mac ships with a different version of sed that requires a delimiter arg
1111
sed -i "" "$core_req_sed_pattern" $target_req_file

.github/scripts/update_dev_dependency_branches.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ set -e
55
dbt_adapters_branch=$1
66
dbt_core_branch=$2
77
dbt_common_branch=$3
8-
target_req_file="dev-requirements.txt"
9-
core_req_sed_pattern="s|dbt-core.git.*#egg=dbt-core|dbt-core.git@${dbt_core_branch}#egg=dbt-core|g"
8+
target_req_file="hatch.toml"
9+
core_req_sed_pattern="s|dbt-core.git.*#subdirectory=core|dbt-core.git@${dbt_core_branch}#subdirectory=core|g"
1010
adapters_req_sed_pattern="s|dbt-adapters.git|dbt-adapters.git@${dbt_adapters_branch}|g"
1111
common_req_sed_pattern="s|dbt-common.git|dbt-common.git@${dbt_common_branch}|g"
1212
if [[ "$OSTYPE" == darwin* ]]; then

.github/workflows/integration.yml

Lines changed: 6 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,6 @@ jobs:
100100
python-version: "3.9"
101101

102102
env:
103-
TOXENV: integration-redshift
104-
PYTEST_ADDOPTS: "-v --color=yes -n4 --csv integration_results.csv"
105103
DBT_INVOCATION_ENV: github-actions
106104
DD_CIVISIBILITY_AGENTLESS_ENABLED: true
107105
DD_API_KEY: ${{ secrets.DATADOG_API_KEY }}
@@ -144,14 +142,9 @@ jobs:
144142
${{ inputs.dbt_adapters_branch }} \
145143
${{ inputs.dbt_core_branch }} \
146144
${{ inputs.dbt_common_branch }}
147-
cat dev-requirements.txt
145+
cat hatch.toml
148146
149-
- name: Install python dependencies
150-
run: |
151-
python -m pip install --user --upgrade pip
152-
python -m pip install tox
153-
python -m pip --version
154-
tox --version
147+
- uses: pypa/hatch@install
155148

156149
- name: Create AWS IAM profiles
157150
run: |
@@ -180,7 +173,7 @@ jobs:
180173
AWS_ROLE_ARN: ${{ secrets.REDSHIFT_TEST_IAM_ROLE_ARN }}
181174
AWS_REGION: ${{ vars.REDSHIFT_TEST_REGION }}
182175

183-
- name: Run tox (redshift)
176+
- run: hatch run integration-tests tests/functional -m "not flaky"
184177
env:
185178
REDSHIFT_TEST_DBNAME: ${{ secrets.REDSHIFT_TEST_DBNAME }}
186179
REDSHIFT_TEST_PASS: ${{ secrets.REDSHIFT_TEST_PASS }}
@@ -196,25 +189,6 @@ jobs:
196189
DBT_TEST_USER_1: dbt_test_user_1
197190
DBT_TEST_USER_2: dbt_test_user_2
198191
DBT_TEST_USER_3: dbt_test_user_3
199-
run: tox -- -m "not flaky" --ddtrace
200-
201-
- uses: actions/upload-artifact@v3
202-
if: always()
203-
with:
204-
name: logs
205-
path: ./logs
206-
207-
- name: Get current date
208-
if: always()
209-
id: date
210-
run: |
211-
echo "date=$(date +'%Y-%m-%dT%H_%M_%S')" >> $GITHUB_OUTPUT #no colons allowed for artifacts
212-
213-
- uses: actions/upload-artifact@v3
214-
if: always()
215-
with:
216-
name: integration_results_${{ matrix.python-version }}_${{ matrix.os }}_redshift-${{ steps.date.outputs.date }}.csv
217-
path: integration_results.csv
218192

219193
test-flaky:
220194
name: redshift / python ${{ matrix.python-version }} / ubuntu-22.04 - flaky
@@ -236,8 +210,6 @@ jobs:
236210
python-version: ["3.9", "3.10", "3.11", "3.12"]
237211

238212
env:
239-
TOXENV: integration-redshift
240-
PYTEST_ADDOPTS: "-v --color=yes -n1 --csv integration_results.csv"
241213
DBT_INVOCATION_ENV: github-actions
242214
DD_CIVISIBILITY_AGENTLESS_ENABLED: true
243215
DD_INSTRUMENTATION_TELEMETRY_ENABLED: false
@@ -274,12 +246,7 @@ jobs:
274246
with:
275247
python-version: ${{ matrix.python-version }}
276248

277-
- name: Install python dependencies
278-
run: |
279-
python -m pip install --user --upgrade pip
280-
python -m pip install tox
281-
python -m pip --version
282-
tox --version
249+
- uses: pypa/hatch@install
283250

284251
- name: Update Adapters and Core branches (update dev_requirements.txt)
285252
if: github.event_name == 'workflow_dispatch'
@@ -288,8 +255,7 @@ jobs:
288255
${{ inputs.dbt_adapters_branch }} \
289256
${{ inputs.dbt_core_branch }} \
290257
${{ inputs.dbt_common_branch }}
291-
cat dev-requirements.txt
292-
258+
cat hatch.toml
293259
294260
- name: Run tox (redshift)
295261
env:
@@ -307,7 +273,7 @@ jobs:
307273
DBT_TEST_USER_1: dbt_test_user_1
308274
DBT_TEST_USER_2: dbt_test_user_2
309275
DBT_TEST_USER_3: dbt_test_user_3
310-
run: tox -- -m flaky --ddtrace
276+
run: hatch run integration-tests tests/functional -m flaky -n1 --ddtrace
311277

312278
require-label-comment:
313279
runs-on: ubuntu-22.04

.github/workflows/main.yml

Lines changed: 12 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,12 @@ jobs:
4848
persist-credentials: false
4949

5050
- name: Set up Python
51-
uses: actions/setup-python@v4
51+
uses: actions/setup-python@v5
5252
with:
5353
python-version: '3.9'
5454

55-
- name: Install python dependencies
56-
run: |
57-
python -m pip install --user --upgrade pip
58-
python -m pip install -r dev-requirements.txt
59-
python -m pip --version
60-
pre-commit --version
61-
6255
- name: pre-commit hooks
63-
run: pre-commit run --all-files --show-diff-on-failure
56+
uses: pre-commit/[email protected]
6457

6558
unit:
6659
name: unit test / python ${{ matrix.python-version }}
@@ -72,10 +65,6 @@ jobs:
7265
matrix:
7366
python-version: ['3.9', '3.10', '3.11', '3.12']
7467

75-
env:
76-
TOXENV: "unit"
77-
PYTEST_ADDOPTS: "-v --color=yes --csv unit_results.csv"
78-
7968
steps:
8069
- name: Check out the repository
8170
uses: actions/checkout@v4
@@ -88,27 +77,9 @@ jobs:
8877
python-version: ${{ matrix.python-version }}
8978

9079
- name: Install python dependencies
91-
run: |
92-
python -m pip install --user --upgrade pip
93-
python -m pip install tox
94-
python -m pip --version
95-
tox --version
96-
97-
- name: Run tox
98-
run: tox
99-
100-
- name: Get current date
101-
if: always()
102-
id: date
103-
#no colons allowed for artifacts
104-
run: |
105-
echo "date=$(date +'%Y-%m-%dT%H_%M_%S')" >> $GITHUB_OUTPUT
80+
uses: pypa/hatch@install
10681

107-
- uses: actions/upload-artifact@v3
108-
if: always()
109-
with:
110-
name: unit_results_${{ matrix.python-version }}-${{ steps.date.outputs.date }}.csv
111-
path: unit_results.csv
82+
- run: hatch run unit-tests
11283

11384
build:
11485
name: build packages
@@ -130,24 +101,16 @@ jobs:
130101
python-version: '3.9'
131102

132103
- name: Install python dependencies
133-
run: |
134-
python -m pip install --user --upgrade pip
135-
python -m pip install --upgrade setuptools wheel twine check-wheel-contents
136-
python -m pip --version
104+
uses: pypa/hatch@install
137105

138106
- name: Build distributions
139-
run: ./scripts/build-dist.sh
107+
run: hatch build
140108

141109
- name: Show distributions
142110
run: ls -lh dist/
143111

144112
- name: Check distribution descriptions
145-
run: |
146-
twine check dist/*
147-
148-
- name: Check wheel contents
149-
run: |
150-
check-wheel-contents dist/*.whl --ignore W007,W008
113+
run: hatch run build:check-all
151114

152115
- name: Check if this is an alpha version
153116
id: check-is-alpha
@@ -156,11 +119,6 @@ jobs:
156119
if [[ "$(ls -lh dist/)" == *"a1"* ]]; then export is_alpha=1; fi
157120
echo "is_alpha=$is_alpha" >> $GITHUB_OUTPUT
158121
159-
- uses: actions/upload-artifact@v3
160-
with:
161-
name: dist
162-
path: dist/
163-
164122
test-build:
165123
name: verify packages / python ${{ matrix.python-version }} / ${{ matrix.os }}
166124

@@ -175,6 +133,7 @@ jobs:
175133
matrix:
176134
os: [ubuntu-22.04, macos-14, windows-2022]
177135
python-version: ['3.9', '3.10', '3.11', '3.12']
136+
dist-type: ["whl", "gz"]
178137
exclude:
179138
# psycopg2-binary doesn't have a precompiled wheel for python 3.9 for mac
180139
- os: macos-14
@@ -186,32 +145,13 @@ jobs:
186145
with:
187146
python-version: ${{ matrix.python-version }}
188147

189-
- name: Install python dependencies
190-
run: |
191-
python -m pip install --user --upgrade pip
192-
python -m pip install --upgrade wheel
193-
python -m pip --version
194-
195-
- uses: actions/download-artifact@v3
196-
with:
197-
name: dist
198-
path: dist/
199-
200148
- name: Show distributions
201149
run: ls -lh dist/
202150

203-
- name: Install wheel distributions
204-
run: |
205-
find ./dist/*.whl -maxdepth 1 -type f | xargs python -m pip install --force-reinstall --find-links=dist/
206-
207-
- name: Check wheel distributions
208-
run: |
209-
python -c "import dbt.adapters.redshift"
210-
211-
- name: Install source distributions
151+
- name: Install ${{ matrix.dist-type }} distributions
212152
run: |
213-
find ./dist/*.gz -maxdepth 1 -type f | xargs python -m pip install --force-reinstall --find-links=dist/
153+
find ./dist/*.${{ matrix.dist-type }} -maxdepth 1 -type f | xargs python -m pip install --force-reinstall --find-links=dist/
214154
215-
- name: Check source distributions
155+
- name: Check ${{ matrix.dist-type }} distributions
216156
run: |
217-
python -c "import dbt.adapters.redshift"
157+
python -c "import dbt.adapters.bigquery"

.github/workflows/nightly-release.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,15 @@ jobs:
5050
commit_sha=$(git rev-parse HEAD)
5151
echo "release_commit=$commit_sha" >> $GITHUB_OUTPUT
5252
53-
- name: "Get Current Version Number"
54-
id: version-number-sources
55-
run: |
56-
current_version=`awk -F"current_version = " '{print $2}' .bumpversion.cfg | tr '\n' ' '`
57-
echo "current_version=$current_version" >> $GITHUB_OUTPUT
53+
- name: Set up Python
54+
uses: actions/setup-python@v5
55+
with:
56+
python-version: '3.9'
57+
58+
- uses: pypa/hatch@install
59+
60+
- id: version-number-sources
61+
run: echo "current_version=$(hatch version)" >> $GITHUB_OUTPUT
5862

5963
- name: "Audit Version And Parse Into Parts"
6064
id: semver

0 commit comments

Comments
 (0)