Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix iceberg full refresh#247 #252

Merged
merged 87 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
4e26166
first commit
Oct 30, 2023
caeca5e
revert pr template
Oct 30, 2023
80fa1d7
fix when existing_relation_type is none
Oct 30, 2023
fa85d32
Fixed unit tests test_glue_session.py and test_glue_session_demo.py
moomindani Oct 31, 2023
199d622
Added debug logs and fixed some tests
moomindani Oct 31, 2023
036955b
Fix single_functional test
aajisaka Nov 1, 2023
78106a4
Merge pull request #1 from aajisaka/fix_unit_tests
moomindani Nov 1, 2023
048b9c7
Bump dbt-tests-adapter from 1.6.6 to 1.6.7
dependabot[bot] Nov 1, 2023
c095ac6
Fixed functional_test
moomindani Nov 1, 2023
6a51320
Merge pull request #256 from aws-samples/dependabot/pip/dbt-tests-ada…
menuetb Nov 2, 2023
fdf8cdf
Bump dbt-tests-adapter from 1.6.7 to 1.7.0
dependabot[bot] Nov 2, 2023
bb2ffe3
Fixed functional/adapter/test_basic.py
moomindani Nov 7, 2023
df43bc1
Fixed exception handling and cursor issue
moomindani Nov 7, 2023
cefed9e
Renamed functional_test/adapter/test_basic.py to test_basic_functiona…
moomindani Nov 7, 2023
398333d
Updated README
moomindani Nov 7, 2023
07b6100
Merge pull request #257 from aws-samples/dependabot/pip/dbt-tests-ada…
menuetb Nov 7, 2023
03f2d24
Merge pull request #253 from moomindani/fix_unit_tests
menuetb Nov 7, 2023
4f2a5e5
Update to version 1.7
menuetb Nov 7, 2023
f028c83
Added CI
moomindani Nov 8, 2023
3c26eec
Bump dbt-tests-adapter from 1.7.0 to 1.7.1
dependabot[bot] Nov 8, 2023
7cd2241
Bump black from 23.10.1 to 23.11.0
dependabot[bot] Nov 8, 2023
7f401c7
now correctly delete the table
Nov 8, 2023
7295153
cleaner
Nov 8, 2023
60713bd
Update CI
moomindani Nov 9, 2023
9b34097
Update CI
moomindani Nov 9, 2023
fd06f6b
Update CI
moomindani Nov 9, 2023
4985298
Update CI
moomindani Nov 9, 2023
fe8d07a
Update CI
moomindani Nov 9, 2023
5c587b3
Update CI
moomindani Nov 9, 2023
5b0ba6f
Update CI
moomindani Nov 9, 2023
4d6cb7b
Update CI
moomindani Nov 9, 2023
b7eea76
Increased timeout for integ test
moomindani Nov 9, 2023
b3b694f
Update unit tests and CI
moomindani Nov 9, 2023
8cc9cfe
Added unit test for Lake Formation
moomindani Nov 9, 2023
71309d2
Added test for Glue default version
moomindani Nov 9, 2023
513f285
Renamed test class
moomindani Nov 9, 2023
1b1578f
Merge pull request #258 from moomindani/main
menuetb Nov 9, 2023
edefa82
Merge branch 'main' into dependabot/pip/black-23.11.0
menuetb Nov 9, 2023
095f61f
Merge pull request #260 from aws-samples/dependabot/pip/black-23.11.0
menuetb Nov 9, 2023
9c44859
Merge branch 'main' into dependabot/pip/dbt-tests-adapter-1.7.1
menuetb Nov 9, 2023
bb5eb01
Merge pull request #259 from aws-samples/dependabot/pip/dbt-tests-ada…
menuetb Nov 9, 2023
ed34068
Updated dependency for 1.7.1
moomindani Nov 9, 2023
290da5f
Configured concurrency control for tests
moomindani Nov 9, 2023
63b37cc
Configured concurrency control for tests
moomindani Nov 9, 2023
ac68fa0
Configured concurrency control for tests
moomindani Nov 9, 2023
aac8117
Merge pull request #261 from moomindani/main
menuetb Nov 9, 2023
9fb45f9
Change requirements
menuetb Nov 9, 2023
9f43ee6
Merge pull request #262 from aws-samples/change_requierments
menuetb Nov 9, 2023
ea7b809
fix spark version
menuetb Nov 9, 2023
2e16ac7
Merge pull request #263 from aws-samples/change_requierments
menuetb Nov 9, 2023
f91b38e
Update tox.ini
dataders Nov 9, 2023
c2bb5a9
Add integration test for all PR
menuetb Nov 9, 2023
7f167ee
Add labeled based functional test
menuetb Nov 9, 2023
bf23d5e
Merge pull request #265 from aws-samples/integration_test
menuetb Nov 9, 2023
170d977
Remove unnecessary extra_py_files for Delta Lake
aajisaka Nov 10, 2023
3ad6d2a
Added unit test for test_hudi_merge_table with Mock using moto and mo…
moomindani Nov 10, 2023
e61215e
Moved S3Url util class to util.py
moomindani Nov 10, 2023
befb4d1
Renamed util.py for unit tests
moomindani Nov 10, 2023
fc45930
Update CHANGELOG
aajisaka Nov 10, 2023
1317e89
Fix unit test
moomindani Nov 10, 2023
c6ed306
Fixed test_generic_tests
moomindani Nov 10, 2023
d095ec8
Merge pull request #268 from moomindani/refine_tests
menuetb Nov 10, 2023
203892f
[minor][doc] Fix Iceberg config in README
aajisaka Nov 10, 2023
f5c40fc
Merge pull request #267 from aajisaka/fix-delta-py-file
menuetb Nov 10, 2023
d98dc06
Merge pull request #269 from aajisaka/fix-iceberg-doc
menuetb Nov 10, 2023
8c663b6
fix test generic (#270)
menuetb Nov 10, 2023
bdc6070
fix test generic (#271)
menuetb Nov 10, 2023
975167f
Fix test generic (#272)
menuetb Nov 10, 2023
25b6bfe
beauty
Nov 13, 2023
4d12ac1
duplicate line of code
Nov 13, 2023
3c054d0
Fix test generic (#276)
menuetb Nov 13, 2023
ef5cdf0
Migrate snapshot test and docs test from functional_test to functiona…
moomindani Nov 13, 2023
7c9c412
use drop_relation instead of glue__drop_relation
Nov 13, 2023
5c827a6
Bump mypy from 1.6.1 to 1.7.0 (#273)
dependabot[bot] Nov 14, 2023
87359dd
Update moto requirement from ~=4.2.7 to ~=4.2.8 (#277)
dependabot[bot] Nov 14, 2023
acadda6
all basic tests enabled (#278)
moomindani Nov 14, 2023
879f41a
Revert the change in get_result_from_cursor to fix test (#279)
aajisaka Nov 15, 2023
bbbc05a
Fix integ tests (#280)
moomindani Nov 15, 2023
97ca609
first commit
Oct 30, 2023
4249e08
revert pr template
Oct 30, 2023
20949b7
fix when existing_relation_type is none
Oct 30, 2023
bef16ed
now correctly delete the table
Nov 8, 2023
0e4e7c1
cleaner
Nov 8, 2023
a5cd470
beauty
Nov 13, 2023
3e43a6e
duplicate line of code
Nov 13, 2023
b611bb5
use drop_relation instead of glue__drop_relation
Nov 13, 2023
9083b21
Merge branch 'fix-iceberg-full-refresh#247' of https://github.com/san…
Nov 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ resolves #
- [ ] I have updated the `CHANGELOG.md` and added information about my change to the "dbt-glue next" section.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
157 changes: 157 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
name: Integration Tests

on:
# we use pull_request_target to run the CI also for forks
pull_request_target:
types: [opened, reopened, synchronize, labeled]
push:
branches: [main]

permissions:
id-token: write
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ contains(github.event_name, 'pull_request') && github.event.pull_request.head.ref || github.sha }}
cancel-in-progress: true

defaults:
run:
shell: bash

jobs:
# workflow that is invoked when for PRs with labels 'enable-functional-tests'
functional-tests-pr:
name: Functional Tests - PR / python ${{ matrix.python-version }}
if: contains(github.event.pull_request.labels.*.name, 'enable-functional-tests')

runs-on: ubuntu-latest
timeout-minutes: 60

strategy:
fail-fast: false
matrix:
python-version: ["3.10"] # Use single version to avoid resource conflicts in an AWS account

env:
TOXENV: "integration"
PYTEST_ADDOPTS: "-v --color=yes --csv integ_results.csv"
DBT_AWS_ACCOUNT: ${{ secrets.DBT_AWS_ACCOUNT }}
DBT_GLUE_ROLE_ARN: ${{ secrets.DBT_GLUE_ROLE_ARN }}
DBT_GLUE_REGION: ${{ secrets.DBT_GLUE_REGION }}

steps:
- name: Check out the repository
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install python dependencies
run: |
sudo apt-get update
sudo apt-get install libsasl2-dev
python -m pip install --user --upgrade pip
python -m pip --version
python -m pip install tox
tox --version

- name: Generate session name
id: session
run: |
repo="${GITHUB_REPOSITORY#${GITHUB_REPOSITORY_OWNER}/}"
echo "name=${repo}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" >> "${GITHUB_OUTPUT}"

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-session-name: ${{ steps.session.outputs.name }}
role-to-assume: arn:aws:iam::${{ secrets.DBT_AWS_ACCOUNT }}:role/dbt-glue
aws-region: ${{ secrets.DBT_GLUE_REGION }}
mask-aws-account-id: true

- name: Run tox
run: |
export DBT_S3_LOCATION=${{ secrets.DBT_S3_LOCATION }}/${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}/${{ matrix.python-version }}
tox

- name: Get current date
if: always()
id: date
run: echo "date=$(date +'%Y-%m-%dT%H_%M_%S')" >> $GITHUB_OUTPUT #no colons allowed for artifacts

- uses: actions/upload-artifact@v3
if: always()
with:
name: unit_results_${{ matrix.python-version }}-${{ steps.date.outputs.date }}.csv
path: unit_results.csv

# workflow that is invoked when a push to main happens
functional-tests-main:
name: Functional Tests - main / python ${{ matrix.python-version }}
if: github.event_name == 'push' && github.ref == 'refs/heads/main'

runs-on: ubuntu-latest
timeout-minutes: 60

strategy:
fail-fast: false
matrix:
python-version: ["3.10"] # Use single version to avoid resource conflicts in an AWS account

env:
TOXENV: "integration"
PYTEST_ADDOPTS: "-v --color=yes --csv integ_results.csv -s"
DBT_AWS_ACCOUNT: ${{ secrets.DBT_AWS_ACCOUNT }}
DBT_GLUE_ROLE_ARN: ${{ secrets.DBT_GLUE_ROLE_ARN }}
DBT_GLUE_REGION: ${{ secrets.DBT_GLUE_REGION }}

steps:
- name: Check out the repository
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install python dependencies
run: |
sudo apt-get update
sudo apt-get install libsasl2-dev
python -m pip install --user --upgrade pip
python -m pip --version
python -m pip install tox
tox --version

- name: Generate session name
id: session
run: |
repo="${GITHUB_REPOSITORY#${GITHUB_REPOSITORY_OWNER}/}"
echo "name=${repo}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" >> "${GITHUB_OUTPUT}"

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-session-name: ${{ steps.session.outputs.name }}
role-to-assume: arn:aws:iam::${{ secrets.DBT_AWS_ACCOUNT }}:role/dbt-glue
aws-region: ${{ secrets.DBT_GLUE_REGION }}
mask-aws-account-id: true

- name: Run tox
run: |
export DBT_S3_LOCATION=${{ secrets.DBT_S3_LOCATION }}/${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}/${{ matrix.python-version }}
tox

- name: Get current date
if: always()
id: date
run: echo "date=$(date +'%Y-%m-%dT%H_%M_%S')" >> $GITHUB_OUTPUT #no colons allowed for artifacts

- uses: actions/upload-artifact@v3
if: always()
with:
name: unit_results_${{ matrix.python-version }}-${{ steps.date.outputs.date }}.csv
path: unit_results.csv
217 changes: 217 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
# **what?**
# Runs code quality checks, unit tests, and verifies python build on
# all code commited to the repository. This workflow should not
# require any secrets since it runs for PRs from forked repos.
# By default, secrets are not passed to workflows running from
# a forked repo.

# **why?**
# Ensure code for dbt meets a certain quality standard.

# **when?**
# This will run for all PRs, when code is pushed to a release
# branch, and when manually triggered.

name: Tests and Code Checks

on:
push:
branches:
- "main"
- "*.latest"
- "releases/*"
paths-ignore:
- "**.MD"
- "**.md"
pull_request:
workflow_dispatch:

permissions:
id-token: write
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ contains(github.event_name, 'pull_request') && github.event.pull_request.head.ref || github.sha }}
cancel-in-progress: true

defaults:
run:
shell: bash

jobs:
# code-quality:
# name: code-quality
#
# runs-on: ubuntu-latest
# timeout-minutes: 10
#
# steps:
# - name: Check out the repository
# uses: actions/checkout@v3
# with:
# persist-credentials: false
#
# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: '3.8'
#
# - name: Install python dependencies
# run: |
# sudo apt-get update
# sudo apt-get install libsasl2-dev
# python -m pip install --user --upgrade pip
# python -m pip --version
# python -m pip install pre-commit
# pre-commit --version
# python -m pip install mypy==0.942
# python -m pip install types-requests
# mypy --version
# python -m pip install -r dev-requirements.txt
# dbt --version
#
# - name: Run pre-commit hooks
# run: pre-commit run --all-files --show-diff-on-failure

unit:
name: unit test / python ${{ matrix.python-version }}

runs-on: ubuntu-latest
timeout-minutes: 10

strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]

env:
TOXENV: "unit"
PYTEST_ADDOPTS: "-v --color=yes --csv unit_results.csv"

steps:
- name: Check out the repository
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install python dependencies
run: |
sudo apt-get update
sudo apt-get install libsasl2-dev
python -m pip install --user --upgrade pip
python -m pip --version
python -m pip install tox
tox --version

- name: Run tox
run: tox

- name: Get current date
if: always()
id: date
run: echo "date=$(date +'%Y-%m-%dT%H_%M_%S')" >> $GITHUB_OUTPUT #no colons allowed for artifacts

- uses: actions/upload-artifact@v3
if: always()
with:
name: unit_results_${{ matrix.python-version }}-${{ steps.date.outputs.date }}.csv
path: unit_results.csv


build:
name: build packages

runs-on: ubuntu-latest

outputs:
is_alpha: ${{ steps.check-is-alpha.outputs.is_alpha }}

steps:
- name: Check out the repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'

- name: Install python dependencies
run: |
python -m pip install --user --upgrade pip
python -m pip install --upgrade setuptools wheel twine check-wheel-contents
python -m pip --version

- name: Build distributions
run: ./scripts/build-dist.sh

- name: Show distributions
run: ls -lh dist/

- name: Check distribution descriptions
run: |
twine check dist/*
- name: Check wheel contents
run: |
check-wheel-contents dist/*.whl --ignore W007,W008

- name: Check if this is an alpha version
id: check-is-alpha
run: |
export is_alpha=0
if [[ "$(ls -lh dist/)" == *"a1"* ]]; then export is_alpha=1; fi
echo "is_alpha=$is_alpha" >> $GITHUB_OUTPUT

- uses: actions/upload-artifact@v3
with:
name: dist
path: dist/

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

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

needs: build

runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install python dependencies
run: |
python -m pip install --user --upgrade pip
python -m pip install --upgrade wheel
python -m pip --version
- uses: actions/download-artifact@v3
with:
name: dist
path: dist/

- name: Show distributions
run: ls -lh dist/

- name: Install wheel distributions
run: |
find ./dist/*.whl -maxdepth 1 -type f | xargs python -m pip install --force-reinstall --find-links=dist/
- name: Check wheel distributions
run: |
dbt --version
- 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
run: |
dbt --version
Loading
Loading