From b109b1884213b23bc6e326663714f70e2dc98eb9 Mon Sep 17 00:00:00 2001 From: colin-rogers-dbt <111200756+colin-rogers-dbt@users.noreply.github.com> Date: Tue, 27 Feb 2024 12:21:42 -0800 Subject: [PATCH 1/8] update dbt-common dependency to <2.0 (#111) --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 1bc90a59..ff26c2b6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", ] dependencies = [ - "dbt-common<1.0", + "dbt-common<2.0", "pytz>=2015.7", # installed via dbt-common but used directly "agate>=1.0,<2.0", From eb4f8e8e78593866efe6b690ddb38ab9a48712e3 Mon Sep 17 00:00:00 2001 From: Github Build Bot Date: Tue, 27 Feb 2024 22:22:23 +0000 Subject: [PATCH 2/8] Bumping version to 1.0.0b1 and generate changelog --- .changes/1.0.0-b1.md | 1 + CHANGELOG.md | 2 ++ dbt/adapters/__about__.py | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 .changes/1.0.0-b1.md diff --git a/.changes/1.0.0-b1.md b/.changes/1.0.0-b1.md new file mode 100644 index 00000000..51535a9f --- /dev/null +++ b/.changes/1.0.0-b1.md @@ -0,0 +1 @@ +## dbt-adapter 1.0.0-b1 - February 27, 2024 diff --git a/CHANGELOG.md b/CHANGELOG.md index 75eaec3e..eea05103 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), and is generated by [Changie](https://github.com/miniscruff/changie). +## dbt-adapter 1.0.0-b1 - February 27, 2024 + ## dbt-adapter 0.1.0-a8 - February 22, 2024 ### Features diff --git a/dbt/adapters/__about__.py b/dbt/adapters/__about__.py index d94aee52..affc65fe 100644 --- a/dbt/adapters/__about__.py +++ b/dbt/adapters/__about__.py @@ -1 +1 @@ -version = "0.1.0a8" +version = "1.0.0b1" From 79061e6136ee7bbfef6e556f721238d13ef2fad6 Mon Sep 17 00:00:00 2001 From: colin-rogers-dbt <111200756+colin-rogers-dbt@users.noreply.github.com> Date: Tue, 27 Feb 2024 15:12:04 -0800 Subject: [PATCH 3/8] Add version bump and changelog (#104) Co-authored-by: Github Build Bot Co-authored-by: FishtownBuildBot <77737458+FishtownBuildBot@users.noreply.github.com> Co-authored-by: Emily Rockman --- .github/actions/build-hatch/action.yml | 14 +- .github/actions/publish-pypi/action.yml | 4 +- .github/workflows/github-release.yml | 259 +++++++++++++++++++++++ .github/workflows/release.yml | 70 +++--- .github/workflows/release_prep_hatch.yml | 23 +- .pre-commit-config.yaml | 63 ++++++ 6 files changed, 376 insertions(+), 57 deletions(-) create mode 100644 .github/workflows/github-release.yml create mode 100644 .pre-commit-config.yaml diff --git a/.github/actions/build-hatch/action.yml b/.github/actions/build-hatch/action.yml index 9c635951..764dc9dc 100644 --- a/.github/actions/build-hatch/action.yml +++ b/.github/actions/build-hatch/action.yml @@ -11,9 +11,12 @@ inputs: working-dir: description: Where to run commands from, supports namespace packaging default: "./" - artifacts-dir: + archive-name: description: Where to upload the artifacts - default: "dist" + required: true + changelog-path: + description: Path to changelog file + required: true runs: using: composite @@ -32,5 +35,8 @@ runs: - name: Upload artifacts uses: actions/upload-artifact@v3 with: - name: ${{ inputs.artifacts-dir}} - path: ${{ inputs.working-dir }}dist/ + name: ${{ inputs.archive-name}} + path: | + ${{ inputs.changelog-path }} + ${{ inputs.working-dir }}dist/ + retention-days: 3 diff --git a/.github/actions/publish-pypi/action.yml b/.github/actions/publish-pypi/action.yml index c97beceb..c1346823 100644 --- a/.github/actions/publish-pypi/action.yml +++ b/.github/actions/publish-pypi/action.yml @@ -2,7 +2,7 @@ name: Publish - PyPI description: Publish artifacts saved during build step to PyPI inputs: - artifacts-dir-name: + archive-name: description: Where to download the artifacts from required: true repository-url: @@ -16,7 +16,7 @@ runs: - name: Download artifacts uses: actions/download-artifact@v3 with: - name: ${{ inputs.artifacts-dir }} + name: ${{ inputs.archive-name }} path: . - name: Publish artifacts to PyPI diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml new file mode 100644 index 00000000..edd25172 --- /dev/null +++ b/.github/workflows/github-release.yml @@ -0,0 +1,259 @@ +# **what?** +# Create a new release on GitHub and include any artifacts in the `/dist` directory of the GitHub artifacts store. +# +# Inputs: +# sha: The commit to attach to this release +# version_number: The release version number (i.e. 1.0.0b1, 1.2.3rc2, 1.0.0) +# changelog_path: Path to the changelog file for release notes +# test_run: Test run (Publish release as draft) +# +# **why?** +# Reusable and consistent GitHub release process. +# +# **when?** +# Call after a successful build. Build artifacts should be ready to release and live in a dist/ directory. +# +# This workflow expects the artifacts to already be built and living in the artifact store of the workflow. +# +# Validation Checks +# +# 1. If no release already exists for this commit and version, create the tag and release it to GitHub. +# 2. If a release already exists for this commit, skip creating the release but finish with a success. +# 3. If a release exists for this commit under a different tag, fail. +# 4. If the commit is already associated with a different release, fail. + +name: GitHub Release + +on: + workflow_call: + inputs: + sha: + description: The commit to attach to this release + required: true + type: string + version_number: + description: The release version number (i.e. 1.0.0b1) + required: true + type: string + changelog_path: + description: Path to the changelog file for release notes + required: true + type: string + test_run: + description: Test run (Publish release as draft) + required: true + type: boolean + archive_name: + description: artifact name to download + required: true + type: string + outputs: + tag: + description: The path to the changelog for this version + value: ${{ jobs.check-release-exists.outputs.tag }} + +permissions: + contents: write + +env: + REPO_LINK: ${{ github.server_url }}/${{ github.repository }} + NOTIFICATION_PREFIX: "[GitHub Release]" + +jobs: + log-inputs: + runs-on: ubuntu-latest + steps: + - name: "[DEBUG] Print Variables" + run: | + echo The last commit sha in the release: ${{ inputs.sha }} + echo The release version number: ${{ inputs.version_number }} + echo Expected Changelog path: ${{ inputs.changelog_path }} + echo Test run: ${{ inputs.test_run }} + echo Repo link: ${{ env.REPO_LINK }} + echo Notification prefix: ${{ env.NOTIFICATION_PREFIX }} + + check-release-exists: + runs-on: ubuntu-latest + outputs: + exists: ${{ steps.release_check.outputs.exists }} + draft_exists: ${{ steps.release_check.outputs.draft_exists }} + tag: ${{ steps.set_tag.outputs.tag }} + + steps: + - name: "Generate Release Tag" + id: set_tag + run: echo "tag=v${{ inputs.version_number }}" >> $GITHUB_OUTPUT + + # When the GitHub CLI doesn't find a release for the given tag, it will exit 1 with a + # message of "release not found". In our case, it's not an actual error, just a + # confirmation that the release does not already exists so we can go ahead and create it. + # The `|| true` makes it so the step does not exit with a non-zero exit code + # Also check if the release already exists is draft state. If it does, and we are not + # testing then we can publish that draft as is. If it's in draft and we are testing, skip the + # release. + - name: "Check If Release Exists For Tag ${{ steps.set_tag.outputs.tag }}" + id: release_check + run: | + output=$((gh release view ${{ steps.set_tag.outputs.tag }} --json isDraft,targetCommitish --repo ${{ env.REPO_LINK }}) 2>&1) || true + if [[ "$output" == "release not found" ]] + then + title="Release for tag ${{ steps.set_tag.outputs.tag }} does not exist." + message="Check passed." + echo "exists=false" >> $GITHUB_OUTPUT + echo "draft_exists=false" >> $GITHUB_OUTPUT + echo "::notice title=${{ env.NOTIFICATION_PREFIX }}: $title::$message" + exit 0 + fi + commit=$(jq -r '.targetCommitish' <<< "$output") + if [[ $commit != ${{ inputs.sha }} ]] + then + title="Release for tag ${{ steps.set_tag.outputs.tag }} already exists for commit $commit!" + message="Cannot create a new release for commit ${{ inputs.sha }}. Exiting." + echo "::error title=${{ env.NOTIFICATION_PREFIX }}: $title::$message" + exit 1 + fi + isDraft=$(jq -r '.isDraft' <<< "$output") + if [[ $isDraft == true ]] && [[ ${{ inputs.test_run }} == false ]] + then + title="Release tag ${{ steps.set_tag.outputs.tag }} already associated with the draft release." + message="Release workflow will publish the associated release." + echo "exists=false" >> $GITHUB_OUTPUT + echo "draft_exists=true" >> $GITHUB_OUTPUT + echo "::notice title=${{ env.NOTIFICATION_PREFIX }}: $title::$message" + exit 0 + fi + title="Release for tag ${{ steps.set_tag.outputs.tag }} already exists." + message="Skip GitHub Release Publishing." + echo "exists=true" >> $GITHUB_OUTPUT + echo "draft_exists=false" >> $GITHUB_OUTPUT + echo "::notice title=${{ env.NOTIFICATION_PREFIX }}: $title::$message" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REPO: ${{ env.REPO_LINK }} + + - name: "[DEBUG] Log Job Outputs" + run: | + echo exists: ${{ steps.release_check.outputs.exists }} + echo draft_exists: ${{ steps.release_check.outputs.draft_exists }} + echo tag: ${{ steps.set_tag.outputs.tag }} + + skip-github-release: + runs-on: ubuntu-latest + needs: [check-release-exists] + if: needs.check-release-exists.outputs.exists == 'true' + + steps: + - name: "Tag Exists, Skip GitHub Release Job" + run: | + echo title="A tag already exists for ${{ needs.check-release-exists.outputs.tag }} and commit." + echo message="Skipping GitHub release." + echo "::notice title=${{ env.NOTIFICATION_PREFIX }}: $title::$message" + + audit-release-different-commit: + runs-on: ubuntu-latest + needs: [check-release-exists] + if: needs.check-release-exists.outputs.exists == 'false' + + steps: + - name: "Check If Release Already Exists For Commit" + uses: cardinalby/git-get-release-action@1.2.4 + id: check_release_commit + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + commitSha: ${{ inputs.sha }} + doNotFailIfNotFound: true # returns blank outputs when not found instead of error + searchLimit: 15 # Since we only care about recent releases, speed up the process + + - name: "[DEBUG] Print Release Details" + run: | + echo steps.check_release_commit.outputs.id: ${{ steps.check_release_commit.outputs.id }} + echo steps.check_release_commit.outputs.tag_name: ${{ steps.check_release_commit.outputs.tag_name }} + echo steps.check_release_commit.outputs.target_commitish: ${{ steps.check_release_commit.outputs.target_commitish }} + echo steps.check_release_commit.outputs.prerelease: ${{ steps.check_release_commit.outputs.prerelease }} + + # Since we already know a release for this tag does not exist, if we find anything it's for the wrong tag, exit + - name: "Check If The Tag Matches The Version Number" + if: steps.check_release_commit.outputs.id != '' + run: | + title="Tag ${{ steps.check_release_commit.outputs.tag_name }} already exists for this commit!" + message="Cannot create a new tag for ${{ needs.check-release-exists.outputs.tag }} for the same commit" + echo "::error title=${{ env.NOTIFICATION_PREFIX }}: $title::$message" + exit 1 + + publish-draft-release: + runs-on: ubuntu-latest + needs: [check-release-exists, audit-release-different-commit] + if: >- + needs.check-release-exists.outputs.draft_exists == 'true' && + inputs.test_run == false + + steps: + - name: "Publish Draft Release - ${{ needs.check-release-exists.outputs.tag }}" + run: | + gh release edit $TAG --draft=false --repo ${{ env.REPO_LINK }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAG: ${{ needs.check-release-exists.outputs.tag }} + + create-github-release: + runs-on: ubuntu-latest + needs: [check-release-exists, audit-release-different-commit] + if: needs.check-release-exists.outputs.draft_exists == 'false' + + steps: + - name: "Check out repository" + uses: actions/checkout@v4 + with: + ref: ${{ inputs.sha }} + + - name: "Download Artifact ${{ inputs.archive_name }}" + uses: actions/download-artifact@v3 + with: + name: ${{ inputs.archive_name }} + path: . + + - name: "[DEBUG] Display Structure Of Expected Files" + run: | + ls -R .changes + ls -l dist + + - name: "Set Release Type" + id: release_type + run: | + if ${{ contains(inputs.version_number, 'rc') || contains(inputs.version_number, 'b') }} + then + echo Release will be set as pre-release + echo "prerelease=--prerelease" >> $GITHUB_OUTPUT + else + echo This is not a prerelease + fi + + - name: "Set As Draft Release" + id: draft + run: | + if [[ ${{ inputs.test_run }} == true ]] + then + echo Release will be published as draft + echo "draft=--draft" >> $GITHUB_OUTPUT + else + echo This is not a draft release + fi + + - name: "GitHub Release Workflow Annotation" + run: | + title="Release ${{ needs.check-release-exists.outputs.tag }}" + message="Configuration: ${{ steps.release_type.outputs.prerelease }} ${{ steps.draft.outputs.draft }}" + echo "::notice title=${{ env.NOTIFICATION_PREFIX }}: $title::$message" + + - name: "Create New GitHub Release - ${{ needs.check-release-exists.outputs.tag }}" + run: | + gh release create $TAG ./dist/* --title "$TITLE" --notes-file $RELEASE_NOTES --target $COMMIT $PRERELEASE $DRAFT --repo ${{ env.REPO_LINK }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAG: ${{ needs.check-release-exists.outputs.tag }} + TITLE: ${{ github.event.repository.name }} ${{ needs.check-release-exists.outputs.tag }} + RELEASE_NOTES: ${{ inputs.changelog_path }} + COMMIT: ${{ inputs.sha }} + PRERELEASE: ${{ steps.release_type.outputs.prerelease }} + DRAFT: ${{ steps.draft.outputs.draft }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index baa32604..f650309a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -60,6 +60,7 @@ on: # this is the permission that allows creating a new release permissions: contents: write + id-token: write # will cancel previous workflows triggered by the same event and for the same ref for PRs or same SHA otherwise concurrency: @@ -71,17 +72,14 @@ defaults: shell: bash jobs: - bump-version-generate-changelog: - name: Bump package version, Generate changelog - uses: dbt-labs/dbt-adapters/.github/workflows/release_prep_hatch.yml@bumpVersion - + name: "Bump package version, Generate changelog" + uses: dbt-labs/dbt-adapters/.github/workflows/release_prep_hatch.yml@main with: version_number: ${{ inputs.version_number }} deploy_to: ${{ inputs.deploy-to }} nightly_release: ${{ inputs.nightly_release }} target_branch: ${{ inputs.target_branch }} - secrets: inherit log-outputs-bump-version-generate-changelog: @@ -97,7 +95,7 @@ jobs: build-and-test: name: "Build and Test" - needs: [log-outputs-bump-version-generate-changelog] + needs: [log-outputs-bump-version-generate-changelog, bump-version-generate-changelog] runs-on: ubuntu-latest permissions: id-token: write # IMPORTANT: this permission is mandatory for trusted publishing @@ -107,69 +105,51 @@ jobs: with: ref: ${{ needs.bump-version-generate-changelog.outputs.final_sha }} - - name: Setup `hatch` - uses: ./.github/actions/setup-hatch + - name: "Setup `hatch`" + uses: dbt-labs/dbt-adapters/.github/actions/setup-hatch@main - - name: Build `dbt-adapters` + - name: "Build `dbt-adapters`" if: ${{ inputs.package == 'dbt-adapters' }} - uses: ./.github/actions/build-hatch - - - name: Build `dbt-tests-adapter` - if: ${{ inputs.package == 'dbt-tests-adapter' }} - uses: ./.github/actions/build-hatch + uses: dbt-labs/dbt-adapters/.github/actions/build-hatch@main with: - working-dir: "./dbt-tests-adapter/" - - - name: Setup `hatch` - uses: ./.github/actions/setup-hatch + changelog-path: ${{ needs.bump-version-generate-changelog.outputs.changelog_path }} + archive-name: ${{ inputs.version_number }}-${{ inputs.package }}-${{ inputs.deploy-to }} - - name: Build `dbt-adapters` - if: ${{ inputs.package == 'dbt-adapters' }} - uses: ./.github/actions/build-hatch - - - name: Build `dbt-tests-adapter` + - name: "Build `dbt-tests-adapter`" if: ${{ inputs.package == 'dbt-tests-adapter' }} - uses: ./.github/actions/build-hatch + uses: dbt-labs/dbt-adapters/.github/actions/build-hatch@main with: + changelog-path: ${{ needs.bump-version-generate-changelog.outputs.changelog_path }} working-dir: "./dbt-tests-adapter/" - - # this step is only needed for the release process - - name: "Upload Build Artifact" - if: ${{ github.event_name == 'workflow_call' }} - uses: actions/upload-artifact@v3 - with: - name: ${{ steps.version.outputs.version_number }} - path: | - ${{ inputs.changelog_path }} - ./dist/ - retention-days: 3 + archive-name: ${{ inputs.version_number }}-${{ inputs.package }}-${{ inputs.deploy-to }} github-release: - name: GitHub Release + name: "GitHub Release" if: ${{ !failure() && !cancelled() }} - - needs: [build-and-test] - - uses: dbt-labs/dbt-release/.github/workflows/github-release.yml@main - + needs: [build-and-test, bump-version-generate-changelog] + uses: dbt-labs/dbt-adapters/.github/workflows/github-release.yml@main with: + sha: ${{ needs.bump-version-generate-changelog.outputs.final_sha }} version_number: ${{ inputs.version_number }} changelog_path: ${{ needs.bump-version-generate-changelog.outputs.changelog_path }} test_run: ${{ inputs.deploy-to == 'test' && true || false }} - sha: ${{ needs.bump-version-generate-changelog.outputs.final_sha }} + archive_name: ${{ inputs.version_number }}-${{ inputs.package }}-${{ inputs.deploy-to }} pypi-release: - name: Publish to PyPI + name: "Publish to PyPI" runs-on: ubuntu-latest needs: [github-release] environment: name: ${{ inputs.deploy-to }} url: ${{ vars.PYPI_PROJECT_URL }} steps: + - name: "Check out repository" + uses: actions/checkout@v4 + - name: "Publish to PyPI" - uses: ./.github/actions/publish-pypi + uses: dbt-labs/dbt-adapters/.github/actions/publish-pypi@main with: repository-url: ${{ vars.PYPI_REPOSITORY_URL }} - artifacts-dir: ${{ inputs.version_number }} + archive-name: ${{ inputs.version_number }}-${{ inputs.package }}-${{ inputs.deploy-to }} diff --git a/.github/workflows/release_prep_hatch.yml b/.github/workflows/release_prep_hatch.yml index c32e0a2f..38c399d9 100644 --- a/.github/workflows/release_prep_hatch.yml +++ b/.github/workflows/release_prep_hatch.yml @@ -65,6 +65,9 @@ on: changelog_path: description: The path to the changelog for this version value: ${{ jobs.audit-changelog.outputs.changelog_path }} + final_sha: + description: The sha that will actually be released + value: ${{ jobs.determine-release-branch.outputs.final_sha }} secrets: FISHTOWN_BOT_PAT: description: "Token to commit/merge changes into branches" @@ -201,6 +204,7 @@ jobs: - name: "[DEBUG] Print Outputs" run: | echo up_to_date: ${{ steps.version-check.outputs.up_to_date }} + skip-generate-changelog: runs-on: ubuntu-latest needs: [audit-changelog] @@ -213,6 +217,7 @@ jobs: title="Skip changelog generation" message="A changelog file already exists at ${{ needs.audit-changelog.outputs.changelog_path }}, skipping generating changelog" echo "::notice title=${{ env.NOTIFICATION_PREFIX }}: $title::$message" + skip-version-bump: runs-on: ubuntu-latest needs: [audit-version-in-code] @@ -225,6 +230,7 @@ jobs: title="Skip version bump" message="The version has already been bumped to ${{ inputs.version_number }}, skipping version bump" echo "::notice title=${{ env.NOTIFICATION_PREFIX }}: $title::$message" + create-temp-branch: runs-on: ubuntu-latest needs: [audit-changelog, audit-version-in-code] @@ -344,13 +350,13 @@ jobs: - name: "Remove Trailing Whitespace Via Pre-commit" continue-on-error: true run: | - pre-commit run trailing-whitespace --files dbt_common/__about__.py CHANGELOG.md .changes/* + pre-commit run trailing-whitespace --files dbt/adapters/__about__.py CHANGELOG.md .changes/* git status # this step will fail on newline errors but also correct them - name: "Removing Extra Newlines Via Pre-commit" continue-on-error: true run: | - pre-commit run end-of-file-fixer --files dbt_common/__about__.py CHANGELOG.md .changes/* + pre-commit run end-of-file-fixer --files dbt/adapters/__about__.py CHANGELOG.md .changes/* git status - name: "Commit & Push Changes" run: | @@ -434,7 +440,7 @@ jobs: needs: [run-unit-tests, run-integration-tests, create-temp-branch, audit-version-in-code, audit-changelog] if: | !failure() && !cancelled() && - inputs.deploy_to == 'test' && + inputs.deploy_to == 'prod' && ( needs.audit-changelog.outputs.exists == 'false' || needs.audit-version-in-code.outputs.up_to_date == 'false' @@ -449,11 +455,11 @@ jobs: - name: "Checkout Repo ${{ github.repository }}" uses: actions/checkout@v3 - - name: "Merge Changes Into main" + - name: "Merge Changes Into ${{ inputs.target_branch }}" uses: everlytic/branch-merge@1.1.5 with: source_ref: ${{ needs.create-temp-branch.outputs.branch_name }} - target_branch: "main" + target_branch: ${{ inputs.target_branch }} github_token: ${{ secrets.FISHTOWN_BOT_PAT }} commit_message_template: "[Automated] Merged {source_ref} into target {target_branch} during release process" @@ -495,7 +501,7 @@ jobs: then branch=${{ needs.create-temp-branch.outputs.branch_name }} else - branch="main" + branch="${{ inputs.target_branch }}" fi echo "target_branch=$branch" >> $GITHUB_OUTPUT - name: "[Notification] Resolve Branch To Checkout" @@ -511,6 +517,11 @@ jobs: - name: "[Debug] Log Branch" run: git status + - name: "Resolve Commit SHA For Release" + id: resolve_commit_sha + run: | + echo "release_sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT + - name: "Remove Temp Branch - ${{ needs.create-temp-branch.outputs.branch_name }}" if: ${{ inputs.deploy_to == 'prod' && inputs.nightly_release == 'false' && needs.create-temp-branch.outputs.branch_name != '' }} run: | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..3d80b955 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,63 @@ +# For more on configuring pre-commit hooks (see https://pre-commit.com/) + +# Force all unspecified python hooks to run python 3.8 +default_language_version: + python: python3 + +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: check-yaml + args: [--unsafe] + - id: check-json + - id: end-of-file-fixer + - id: trailing-whitespace + - id: check-case-conflict +- repo: https://github.com/psf/black + rev: 23.1.0 + hooks: + - id: black + additional_dependencies: ['click~=8.1'] + args: + - "--line-length=99" + - "--target-version=py38" + - id: black + alias: black-check + stages: [manual] + additional_dependencies: ['click~=8.1'] + args: + - "--line-length=99" + - "--target-version=py38" + - "--check" + - "--diff" +- repo: https://github.com/pycqa/flake8 + rev: 6.0.0 + hooks: + - id: flake8 + - id: flake8 + alias: flake8-check + stages: [manual] +- repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.1.1 + hooks: + - id: mypy + # N.B.: Mypy is... a bit fragile. + # + # By using `language: system` we run this hook in the local + # environment instead of a pre-commit isolated one. This is needed + # to ensure mypy correctly parses the project. + + # It may cause trouble in that it adds environmental variables out + # of our control to the mix. Unfortunately, there's nothing we can + # do about per pre-commit's author. + # See https://github.com/pre-commit/pre-commit/issues/730 for details. + args: [--show-error-codes, --ignore-missing-imports, --explicit-package-bases] + files: ^dbt/adapters/.* + language: system + - id: mypy + alias: mypy-check + stages: [manual] + args: [--show-error-codes, --pretty, --ignore-missing-imports, --explicit-package-bases] + files: ^dbt/adapters + language: system From 4c289b150853b94beb67921f2a8dd203abe53cbe Mon Sep 17 00:00:00 2001 From: colin-rogers-dbt <111200756+colin-rogers-dbt@users.noreply.github.com> Date: Tue, 27 Feb 2024 15:34:12 -0800 Subject: [PATCH 4/8] Skip GH Release for dbt-tests-adapters (#112) --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f650309a..72c87cb7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -125,7 +125,8 @@ jobs: github-release: name: "GitHub Release" - if: ${{ !failure() && !cancelled() }} + # ToDo: update GH release to handle adding dbt-tests-adapter and dbt-adapter assets to the same release + if: ${{ !failure() && !cancelled() && inputs.package == 'dbt-adapters' }} needs: [build-and-test, bump-version-generate-changelog] uses: dbt-labs/dbt-adapters/.github/workflows/github-release.yml@main with: From ae26084b51fc344db8ceb5ce1af645f957e526c7 Mon Sep 17 00:00:00 2001 From: Github Build Bot Date: Wed, 28 Feb 2024 21:43:44 +0000 Subject: [PATCH 5/8] Bumping version to 1.8.0a2 and generate changelog --- .changes/1.8.0-a2.md | 1 + CHANGELOG.md | 3 ++- dbt/adapters/__about__.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 .changes/1.8.0-a2.md diff --git a/.changes/1.8.0-a2.md b/.changes/1.8.0-a2.md new file mode 100644 index 00000000..03781092 --- /dev/null +++ b/.changes/1.8.0-a2.md @@ -0,0 +1 @@ +## dbt-adapter 1.8.0-a2 - February 28, 2024 diff --git a/CHANGELOG.md b/CHANGELOG.md index eea05103..c47b4fed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), and is generated by [Changie](https://github.com/miniscruff/changie). +## dbt-adapter 1.8.0-a2 - February 28, 2024 + ## dbt-adapter 1.0.0-b1 - February 27, 2024 ## dbt-adapter 0.1.0-a8 - February 22, 2024 @@ -31,4 +33,3 @@ and is generated by [Changie](https://github.com/miniscruff/changie). * Implement unit testing in CI * Allow version to be specified in either __version__.py or __about__.py * Remove __init__.py file from dbt.tests - diff --git a/dbt/adapters/__about__.py b/dbt/adapters/__about__.py index affc65fe..759fdcd7 100644 --- a/dbt/adapters/__about__.py +++ b/dbt/adapters/__about__.py @@ -1 +1 @@ -version = "1.0.0b1" +version = "1.8.0a2" From 5bc38c3a82befea4554ade05b2ea53edbaf88cc4 Mon Sep 17 00:00:00 2001 From: Mike Alfare <13974384+mikealfare@users.noreply.github.com> Date: Wed, 28 Feb 2024 18:08:14 -0500 Subject: [PATCH 6/8] Add docs section to epic and feature templates (#116) --- .github/ISSUE_TEMPLATE/internal-epic.yml | 18 ++++++++++++++++++ .../internal-feature-implementation.yml | 17 ++++++++++++++--- .github/pull_request_template.md | 4 ++-- 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/internal-epic.yml b/.github/ISSUE_TEMPLATE/internal-epic.yml index 504514a3..2f3bfaa7 100644 --- a/.github/ISSUE_TEMPLATE/internal-epic.yml +++ b/.github/ISSUE_TEMPLATE/internal-epic.yml @@ -59,6 +59,24 @@ body: validations: required: false + - type: textarea + attributes: + label: Documentation + description: | + Provide a list of relevant documentation. Is there a proof of concept? + Does this require and RFCs, ADRs, etc.? + If the documentation exists, link it; if it does not exist yet, reference it descriptively. + + Example: + - [ ] RFC for updating connection interface to accept new parameters + - [ ] POC: https://github.com/dbt-labs/dbt-adapters/pull/42 + value: | + ```[tasklist] + - [ ] Task + ``` + validations: + required: false + - type: textarea attributes: label: Consequences diff --git a/.github/ISSUE_TEMPLATE/internal-feature-implementation.yml b/.github/ISSUE_TEMPLATE/internal-feature-implementation.yml index 217e847b..ab3c4ffc 100644 --- a/.github/ISSUE_TEMPLATE/internal-feature-implementation.yml +++ b/.github/ISSUE_TEMPLATE/internal-feature-implementation.yml @@ -54,7 +54,7 @@ body: - type: textarea attributes: - label: Suggested tests + label: Testing description: | Provide scenarios to test. Include both positive and negative tests if possible. Link to existing similar tests if appropriate. @@ -71,13 +71,24 @@ body: - type: textarea attributes: - label: Are there any security concerns with these changes? + label: Security description: | + Are there any security concerns with these changes? When in doubt, run it by the security team. placeholder: | Example: Logging sensitive data validations: - required: true + required: true + + - type: textarea + attributes: + label: Docs + description: | + Are there any docs the will need to be added or updated? + placeholder: | + Example: We need to document how to configure this new authentication method. + validations: + required: true - type: textarea attributes: diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 747dbc2d..4fc2fcf8 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -30,6 +30,6 @@ resolves # ### Checklist - [ ] I have read [the contributing guide](https://github.com/dbt-labs/dbt-adapter/blob/main/CONTRIBUTING.md) and understand what's expected of me -- [ ] I have run this code in development and it appears to resolve the stated issue +- [ ] I have run this code in development, and it appears to resolve the stated issue - [ ] This PR includes tests, or tests are not required/relevant for this PR -- [ ] This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX +- [ ] This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc.) or this PR has already received feedback and approval from Product or DX From 7620c4f48d8a9c7c0ef7740be1af5c008e3ab820 Mon Sep 17 00:00:00 2001 From: Mike Alfare <13974384+mikealfare@users.noreply.github.com> Date: Fri, 1 Mar 2024 16:49:28 -0500 Subject: [PATCH 7/8] Move the entirety of dbt-tests-adapter into the dbt-tests-adapter directory (#118) --- .github/actions/build-hatch/action.yml | 9 +-- .github/actions/publish-pypi/action.yml | 6 +- .github/workflows/release.yml | 64 +++++++++++++------ .github/workflows/release_prep_hatch.yml | 16 ++++- dbt-tests-adapter/dbt/__init__.py | 6 ++ .../dbt}/tests/__about__.py | 0 .../dbt}/tests/adapter/aliases/fixtures.py | 0 .../tests/adapter/aliases/test_aliases.py | 0 .../dbt}/tests/adapter/basic/__init__.py | 0 .../tests/adapter/basic/expected_catalog.py | 0 .../dbt}/tests/adapter/basic/files.py | 0 .../adapter/basic/test_adapter_methods.py | 0 .../dbt}/tests/adapter/basic/test_base.py | 0 .../tests/adapter/basic/test_docs_generate.py | 0 .../dbt}/tests/adapter/basic/test_empty.py | 0 .../tests/adapter/basic/test_ephemeral.py | 0 .../tests/adapter/basic/test_generic_tests.py | 0 .../tests/adapter/basic/test_incremental.py | 0 .../adapter/basic/test_singular_tests.py | 0 .../basic/test_singular_tests_ephemeral.py | 0 .../adapter/basic/test_snapshot_check_cols.py | 0 .../adapter/basic/test_snapshot_timestamp.py | 0 .../basic/test_table_materialization.py | 0 .../adapter/basic/test_validate_connection.py | 0 .../tests/adapter/caching/test_caching.py | 0 .../dbt}/tests/adapter/catalog/files.py | 0 .../tests/adapter/catalog/relation_types.py | 0 .../tests/adapter/column_types/fixtures.py | 0 .../adapter/column_types/test_column_types.py | 0 .../adapter/concurrency/test_concurrency.py | 0 .../tests/adapter/constraints/fixtures.py | 0 .../adapter/constraints/test_constraints.py | 0 .../dbt}/tests/adapter/dbt_clone/fixtures.py | 0 .../tests/adapter/dbt_clone/test_dbt_clone.py | 0 .../tests/adapter/dbt_debug/test_dbt_debug.py | 0 .../dbt}/tests/adapter/dbt_show/fixtures.py | 0 .../tests/adapter/dbt_show/test_dbt_show.py | 0 .../dbt}/tests/adapter/empty/test_empty.py | 0 .../tests/adapter/ephemeral/test_ephemeral.py | 0 .../dbt}/tests/adapter/grants/base_grants.py | 0 .../adapter/grants/test_incremental_grants.py | 0 .../adapter/grants/test_invalid_grants.py | 0 .../tests/adapter/grants/test_model_grants.py | 0 .../tests/adapter/grants/test_seed_grants.py | 0 .../adapter/grants/test_snapshot_grants.py | 0 .../tests/adapter/hooks/data/seed_model.sql | 0 .../tests/adapter/hooks/data/seed_run.sql | 0 .../dbt}/tests/adapter/hooks/fixtures.py | 0 .../tests/adapter/hooks/test_model_hooks.py | 0 .../tests/adapter/hooks/test_run_hooks.py | 0 .../tests/adapter/incremental/fixtures.py | 0 .../test_incremental_merge_exclude_columns.py | 0 .../test_incremental_on_schema_change.py | 0 .../test_incremental_predicates.py | 0 .../incremental/test_incremental_unique_id.py | 0 .../tests/adapter/materialized_view/basic.py | 0 .../adapter/materialized_view/changes.py | 0 .../tests/adapter/materialized_view/files.py | 0 .../tests/adapter/persist_docs/fixtures.py | 0 .../adapter/persist_docs/test_persist_docs.py | 0 .../adapter/python_model/test_python_model.py | 0 .../tests/adapter/python_model/test_spark.py | 0 .../tests/adapter/query_comment/fixtures.py | 0 .../query_comment/test_query_comment.py | 0 .../relations/test_changing_relation_type.py | 0 .../relations/test_dropping_schema_named.py | 0 .../tests/adapter/simple_copy/fixtures.py | 0 .../simple_copy/test_copy_uppercase.py | 0 .../adapter/simple_copy/test_simple_copy.py | 0 .../tests/adapter/simple_seed/fixtures.py | 0 .../tests/adapter/simple_seed/seed_bom.csv | 0 .../dbt}/tests/adapter/simple_seed/seeds.py | 0 .../tests/adapter/simple_seed/test_seed.py | 0 .../simple_seed/test_seed_type_override.py | 0 .../tests/adapter/simple_snapshot/common.py | 0 .../tests/adapter/simple_snapshot/seeds.py | 0 .../adapter/simple_snapshot/snapshots.py | 0 .../adapter/simple_snapshot/test_snapshot.py | 0 .../store_test_failures_tests/_files.py | 0 .../store_test_failures_tests/basic.py | 0 .../store_test_failures_tests/fixtures.py | 0 .../test_store_test_failures.py | 0 .../unit_testing/test_case_insensitivity.py | 0 .../unit_testing/test_invalid_input.py | 0 .../tests/adapter/unit_testing/test_types.py | 0 .../tests/adapter/utils/base_array_utils.py | 0 .../dbt}/tests/adapter/utils/base_utils.py | 0 .../utils/data_types/base_data_type_macro.py | 0 .../utils/data_types/test_type_bigint.py | 0 .../utils/data_types/test_type_boolean.py | 0 .../utils/data_types/test_type_float.py | 0 .../adapter/utils/data_types/test_type_int.py | 0 .../utils/data_types/test_type_numeric.py | 0 .../utils/data_types/test_type_string.py | 0 .../utils/data_types/test_type_timestamp.py | 0 .../tests/adapter/utils/fixture_any_value.py | 0 .../adapter/utils/fixture_array_append.py | 0 .../adapter/utils/fixture_array_concat.py | 0 .../adapter/utils/fixture_array_construct.py | 0 .../tests/adapter/utils/fixture_bool_or.py | 0 .../utils/fixture_cast_bool_to_text.py | 0 .../tests/adapter/utils/fixture_concat.py | 0 .../tests/adapter/utils/fixture_date_spine.py | 0 .../tests/adapter/utils/fixture_date_trunc.py | 0 .../tests/adapter/utils/fixture_dateadd.py | 0 .../tests/adapter/utils/fixture_datediff.py | 0 .../tests/adapter/utils/fixture_equals.py | 0 .../utils/fixture_escape_single_quotes.py | 0 .../tests/adapter/utils/fixture_except.py | 0 .../adapter/utils/fixture_generate_series.py | 0 .../utils/fixture_get_intervals_between.py | 0 .../utils/fixture_get_powers_of_two.py | 0 .../dbt}/tests/adapter/utils/fixture_hash.py | 0 .../tests/adapter/utils/fixture_intersect.py | 0 .../tests/adapter/utils/fixture_last_day.py | 0 .../tests/adapter/utils/fixture_length.py | 0 .../tests/adapter/utils/fixture_listagg.py | 0 .../adapter/utils/fixture_null_compare.py | 0 .../tests/adapter/utils/fixture_position.py | 0 .../tests/adapter/utils/fixture_replace.py | 0 .../dbt}/tests/adapter/utils/fixture_right.py | 0 .../tests/adapter/utils/fixture_safe_cast.py | 0 .../tests/adapter/utils/fixture_split_part.py | 0 .../adapter/utils/fixture_string_literal.py | 0 .../tests/adapter/utils/test_any_value.py | 0 .../tests/adapter/utils/test_array_append.py | 0 .../tests/adapter/utils/test_array_concat.py | 0 .../adapter/utils/test_array_construct.py | 0 .../dbt}/tests/adapter/utils/test_bool_or.py | 0 .../adapter/utils/test_cast_bool_to_text.py | 0 .../dbt}/tests/adapter/utils/test_concat.py | 0 .../adapter/utils/test_current_timestamp.py | 0 .../tests/adapter/utils/test_date_spine.py | 0 .../tests/adapter/utils/test_date_trunc.py | 0 .../dbt}/tests/adapter/utils/test_dateadd.py | 0 .../dbt}/tests/adapter/utils/test_datediff.py | 0 .../dbt}/tests/adapter/utils/test_equals.py | 0 .../utils/test_escape_single_quotes.py | 0 .../dbt}/tests/adapter/utils/test_except.py | 0 .../adapter/utils/test_generate_series.py | 0 .../utils/test_get_intervals_between.py | 0 .../adapter/utils/test_get_powers_of_two.py | 0 .../dbt}/tests/adapter/utils/test_hash.py | 0 .../tests/adapter/utils/test_intersect.py | 0 .../dbt}/tests/adapter/utils/test_last_day.py | 0 .../dbt}/tests/adapter/utils/test_length.py | 0 .../dbt}/tests/adapter/utils/test_listagg.py | 0 .../tests/adapter/utils/test_null_compare.py | 0 .../dbt}/tests/adapter/utils/test_position.py | 0 .../dbt}/tests/adapter/utils/test_replace.py | 0 .../dbt}/tests/adapter/utils/test_right.py | 0 .../tests/adapter/utils/test_safe_cast.py | 0 .../tests/adapter/utils/test_split_part.py | 0 .../adapter/utils/test_string_literal.py | 0 .../tests/adapter/utils/test_timestamps.py | 0 .../tests/adapter/utils/test_validate_sql.py | 0 dbt-tests-adapter/pyproject.toml | 14 ++-- dbt/adapters/__about__.py | 2 +- pyproject.toml | 1 + 159 files changed, 80 insertions(+), 38 deletions(-) create mode 100644 dbt-tests-adapter/dbt/__init__.py rename {dbt => dbt-tests-adapter/dbt}/tests/__about__.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/aliases/fixtures.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/aliases/test_aliases.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/basic/__init__.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/basic/expected_catalog.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/basic/files.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/basic/test_adapter_methods.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/basic/test_base.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/basic/test_docs_generate.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/basic/test_empty.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/basic/test_ephemeral.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/basic/test_generic_tests.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/basic/test_incremental.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/basic/test_singular_tests.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/basic/test_singular_tests_ephemeral.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/basic/test_snapshot_check_cols.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/basic/test_snapshot_timestamp.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/basic/test_table_materialization.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/basic/test_validate_connection.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/caching/test_caching.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/catalog/files.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/catalog/relation_types.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/column_types/fixtures.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/column_types/test_column_types.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/concurrency/test_concurrency.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/constraints/fixtures.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/constraints/test_constraints.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/dbt_clone/fixtures.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/dbt_clone/test_dbt_clone.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/dbt_debug/test_dbt_debug.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/dbt_show/fixtures.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/dbt_show/test_dbt_show.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/empty/test_empty.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/ephemeral/test_ephemeral.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/grants/base_grants.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/grants/test_incremental_grants.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/grants/test_invalid_grants.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/grants/test_model_grants.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/grants/test_seed_grants.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/grants/test_snapshot_grants.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/hooks/data/seed_model.sql (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/hooks/data/seed_run.sql (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/hooks/fixtures.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/hooks/test_model_hooks.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/hooks/test_run_hooks.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/incremental/fixtures.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/incremental/test_incremental_merge_exclude_columns.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/incremental/test_incremental_on_schema_change.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/incremental/test_incremental_predicates.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/incremental/test_incremental_unique_id.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/materialized_view/basic.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/materialized_view/changes.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/materialized_view/files.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/persist_docs/fixtures.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/persist_docs/test_persist_docs.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/python_model/test_python_model.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/python_model/test_spark.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/query_comment/fixtures.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/query_comment/test_query_comment.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/relations/test_changing_relation_type.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/relations/test_dropping_schema_named.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/simple_copy/fixtures.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/simple_copy/test_copy_uppercase.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/simple_copy/test_simple_copy.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/simple_seed/fixtures.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/simple_seed/seed_bom.csv (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/simple_seed/seeds.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/simple_seed/test_seed.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/simple_seed/test_seed_type_override.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/simple_snapshot/common.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/simple_snapshot/seeds.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/simple_snapshot/snapshots.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/simple_snapshot/test_snapshot.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/store_test_failures_tests/_files.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/store_test_failures_tests/basic.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/store_test_failures_tests/fixtures.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/store_test_failures_tests/test_store_test_failures.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/unit_testing/test_case_insensitivity.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/unit_testing/test_invalid_input.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/unit_testing/test_types.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/base_array_utils.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/base_utils.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/data_types/base_data_type_macro.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/data_types/test_type_bigint.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/data_types/test_type_boolean.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/data_types/test_type_float.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/data_types/test_type_int.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/data_types/test_type_numeric.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/data_types/test_type_string.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/data_types/test_type_timestamp.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/fixture_any_value.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/fixture_array_append.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/fixture_array_concat.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/fixture_array_construct.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/fixture_bool_or.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/fixture_cast_bool_to_text.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/fixture_concat.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/fixture_date_spine.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/fixture_date_trunc.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/fixture_dateadd.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/fixture_datediff.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/fixture_equals.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/fixture_escape_single_quotes.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/fixture_except.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/fixture_generate_series.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/fixture_get_intervals_between.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/fixture_get_powers_of_two.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/fixture_hash.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/fixture_intersect.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/fixture_last_day.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/fixture_length.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/fixture_listagg.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/fixture_null_compare.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/fixture_position.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/fixture_replace.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/fixture_right.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/fixture_safe_cast.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/fixture_split_part.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/fixture_string_literal.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/test_any_value.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/test_array_append.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/test_array_concat.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/test_array_construct.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/test_bool_or.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/test_cast_bool_to_text.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/test_concat.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/test_current_timestamp.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/test_date_spine.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/test_date_trunc.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/test_dateadd.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/test_datediff.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/test_equals.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/test_escape_single_quotes.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/test_except.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/test_generate_series.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/test_get_intervals_between.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/test_get_powers_of_two.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/test_hash.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/test_intersect.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/test_last_day.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/test_length.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/test_listagg.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/test_null_compare.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/test_position.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/test_replace.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/test_right.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/test_safe_cast.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/test_split_part.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/test_string_literal.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/test_timestamps.py (100%) rename {dbt => dbt-tests-adapter/dbt}/tests/adapter/utils/test_validate_sql.py (100%) diff --git a/.github/actions/build-hatch/action.yml b/.github/actions/build-hatch/action.yml index 764dc9dc..fe9825d4 100644 --- a/.github/actions/build-hatch/action.yml +++ b/.github/actions/build-hatch/action.yml @@ -14,9 +14,6 @@ inputs: archive-name: description: Where to upload the artifacts required: true - changelog-path: - description: Path to changelog file - required: true runs: using: composite @@ -35,8 +32,6 @@ runs: - name: Upload artifacts uses: actions/upload-artifact@v3 with: - name: ${{ inputs.archive-name}} - path: | - ${{ inputs.changelog-path }} - ${{ inputs.working-dir }}dist/ + name: ${{ inputs.archive-name }} + path: ${{ inputs.working-dir }}dist/ retention-days: 3 diff --git a/.github/actions/publish-pypi/action.yml b/.github/actions/publish-pypi/action.yml index c1346823..deffc6e3 100644 --- a/.github/actions/publish-pypi/action.yml +++ b/.github/actions/publish-pypi/action.yml @@ -17,7 +17,11 @@ runs: uses: actions/download-artifact@v3 with: name: ${{ inputs.archive-name }} - path: . + path: dist/ + + - name: "[DEBUG]" + run : ls -R + shell: bash - name: Publish artifacts to PyPI uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 72c87cb7..1135adb8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -72,20 +72,55 @@ defaults: shell: bash jobs: + release-inputs: + name: "Release inputs" + runs-on: ubuntu-latest + outputs: + working-dir: ${{ steps.release-inputs.outputs.working-dir }} + run-unit-tests: ${{ steps.release-inputs.outputs.run-unit-tests }} + archive-name: ${{ steps.release-inputs.outputs.archive-name }} + steps: + - name: "Inputs" + id: release-inputs + run: | + working_dir="./" + run_unit_tests=true + archive_name=${{ inputs.package }}-${{ inputs.version_number }}-${{ inputs.deploy-to }} + + if test "${{ inputs.package }}" = "dbt-tests-adapter" + then + working_dir="./dbt-tests-adapter/" + run_unit_tests=false + fi + + echo "working-dir=$working_dir" >> $GITHUB_OUTPUT + echo "run-unit-tests=$run_unit_tests" >> $GITHUB_OUTPUT + echo "archive-name=$archive_name" >> $GITHUB_OUTPUT + + - name: "[DEBUG]" + run: | + echo package : ${{ inputs.package }} + echo working-dir : ${{ steps.release-inputs.outputs.working-dir }} + echo run-unit-tests : ${{ steps.release-inputs.outputs.run-unit-tests }} + echo archive-name : ${{ steps.release-inputs.outputs.archive-name }} + bump-version-generate-changelog: name: "Bump package version, Generate changelog" uses: dbt-labs/dbt-adapters/.github/workflows/release_prep_hatch.yml@main + needs: [release-inputs] with: version_number: ${{ inputs.version_number }} deploy_to: ${{ inputs.deploy-to }} nightly_release: ${{ inputs.nightly_release }} target_branch: ${{ inputs.target_branch }} + working-dir: ${{ needs.release-inputs.outputs.working-dir }} + run-unit-tests: ${{ fromJSON(needs.release-inputs.outputs.run-unit-tests) }} secrets: inherit log-outputs-bump-version-generate-changelog: name: "[Log output] Bump package version, Generate changelog" if: ${{ !failure() && !cancelled() }} - needs: [bump-version-generate-changelog] + needs: [release-inputs, bump-version-generate-changelog] runs-on: ubuntu-latest steps: - name: Print variables @@ -95,7 +130,7 @@ jobs: build-and-test: name: "Build and Test" - needs: [log-outputs-bump-version-generate-changelog, bump-version-generate-changelog] + needs: [release-inputs, bump-version-generate-changelog] runs-on: ubuntu-latest permissions: id-token: write # IMPORTANT: this permission is mandatory for trusted publishing @@ -108,38 +143,29 @@ jobs: - name: "Setup `hatch`" uses: dbt-labs/dbt-adapters/.github/actions/setup-hatch@main - - name: "Build `dbt-adapters`" - if: ${{ inputs.package == 'dbt-adapters' }} - uses: dbt-labs/dbt-adapters/.github/actions/build-hatch@main - with: - changelog-path: ${{ needs.bump-version-generate-changelog.outputs.changelog_path }} - archive-name: ${{ inputs.version_number }}-${{ inputs.package }}-${{ inputs.deploy-to }} - - - name: "Build `dbt-tests-adapter`" - if: ${{ inputs.package == 'dbt-tests-adapter' }} + - name: "Build ${{ inputs.package }}" uses: dbt-labs/dbt-adapters/.github/actions/build-hatch@main with: - changelog-path: ${{ needs.bump-version-generate-changelog.outputs.changelog_path }} - working-dir: "./dbt-tests-adapter/" - archive-name: ${{ inputs.version_number }}-${{ inputs.package }}-${{ inputs.deploy-to }} + working-dir: ${{ needs.release-inputs.outputs.working-dir }} + archive-name: ${{ needs.release-inputs.outputs.archive-name }} github-release: name: "GitHub Release" # ToDo: update GH release to handle adding dbt-tests-adapter and dbt-adapter assets to the same release if: ${{ !failure() && !cancelled() && inputs.package == 'dbt-adapters' }} - needs: [build-and-test, bump-version-generate-changelog] + needs: [release-inputs, build-and-test, bump-version-generate-changelog] uses: dbt-labs/dbt-adapters/.github/workflows/github-release.yml@main with: sha: ${{ needs.bump-version-generate-changelog.outputs.final_sha }} version_number: ${{ inputs.version_number }} changelog_path: ${{ needs.bump-version-generate-changelog.outputs.changelog_path }} test_run: ${{ inputs.deploy-to == 'test' && true || false }} - archive_name: ${{ inputs.version_number }}-${{ inputs.package }}-${{ inputs.deploy-to }} + archive_name: ${{ needs.release-inputs.outputs.archive-name }} pypi-release: name: "Publish to PyPI" runs-on: ubuntu-latest - needs: [github-release] + needs: [release-inputs, build-and-test] environment: name: ${{ inputs.deploy-to }} url: ${{ vars.PYPI_PROJECT_URL }} @@ -151,6 +177,4 @@ jobs: uses: dbt-labs/dbt-adapters/.github/actions/publish-pypi@main with: repository-url: ${{ vars.PYPI_REPOSITORY_URL }} - archive-name: ${{ inputs.version_number }}-${{ inputs.package }}-${{ inputs.deploy-to }} - - + archive-name: ${{ needs.release-inputs.outputs.archive-name }} diff --git a/.github/workflows/release_prep_hatch.yml b/.github/workflows/release_prep_hatch.yml index 38c399d9..32a267e0 100644 --- a/.github/workflows/release_prep_hatch.yml +++ b/.github/workflows/release_prep_hatch.yml @@ -53,6 +53,9 @@ on: type: string required: false default: '' + run-unit-tests: + type: boolean + default: false run-integration-tests: type: boolean default: false @@ -61,6 +64,10 @@ on: type: string required: false default: main + working-dir: + description: "The working directory to use for run statements" + type: string + default: "./" outputs: changelog_path: description: The path to the changelog for this version @@ -100,6 +107,9 @@ jobs: echo Target branch: ${{ inputs.target_branch }} echo Nightly release: ${{ inputs.nightly_release }} echo Optional env setup script: ${{ inputs.env_setup_script_path }} + echo run-unit-tests: ${{ inputs.run-unit-tests }} + echo run-integration-tests: ${{ inputs.run-integration-tests }} + echo working-dir: ${{ inputs.working-dir }} # ENVIRONMENT VARIABLES echo Python target version: ${{ env.PYTHON_TARGET_VERSION }} echo Notification prefix: ${{ env.NOTIFICATION_PREFIX }} @@ -191,6 +201,8 @@ jobs: is_updated=true fi echo "up_to_date=$is_updated" >> $GITHUB_OUTPUT + working-directory: ${{ inputs.working-dir }} + - name: "[Notification] Check Current Version In Code" run: | title="Version check" @@ -339,6 +351,7 @@ jobs: if: needs.audit-version-in-code.outputs.up_to_date == 'false' run: | hatch version ${{ inputs.version_number }} + working-directory: ${{ inputs.working-dir }} - name: "[Notification] Bump Version To ${{ inputs.version_number }}" if: needs.audit-version-in-code.outputs.up_to_date == 'false' run: | @@ -373,6 +386,7 @@ jobs: git push run-unit-tests: + if: inputs.run-unit-tests == true runs-on: ubuntu-latest needs: [create-temp-branch, generate-changelog-bump-version] @@ -433,7 +447,7 @@ jobs: python-version: ${{ env.PYTHON_TARGET_VERSION }} - name: Run tests - run: hatch run test:integration + run: hatch run integration-tests:all merge-changes-into-target-branch: runs-on: ubuntu-latest diff --git a/dbt-tests-adapter/dbt/__init__.py b/dbt-tests-adapter/dbt/__init__.py new file mode 100644 index 00000000..782ff40f --- /dev/null +++ b/dbt-tests-adapter/dbt/__init__.py @@ -0,0 +1,6 @@ +# N.B. +# This will add to the package’s __path__ all subdirectories of directories on sys.path named after the package which effectively combines both modules into a single namespace (dbt.adapters) + +from pkgutil import extend_path + +__path__ = extend_path(__path__, __name__) diff --git a/dbt/tests/__about__.py b/dbt-tests-adapter/dbt/tests/__about__.py similarity index 100% rename from dbt/tests/__about__.py rename to dbt-tests-adapter/dbt/tests/__about__.py diff --git a/dbt/tests/adapter/aliases/fixtures.py b/dbt-tests-adapter/dbt/tests/adapter/aliases/fixtures.py similarity index 100% rename from dbt/tests/adapter/aliases/fixtures.py rename to dbt-tests-adapter/dbt/tests/adapter/aliases/fixtures.py diff --git a/dbt/tests/adapter/aliases/test_aliases.py b/dbt-tests-adapter/dbt/tests/adapter/aliases/test_aliases.py similarity index 100% rename from dbt/tests/adapter/aliases/test_aliases.py rename to dbt-tests-adapter/dbt/tests/adapter/aliases/test_aliases.py diff --git a/dbt/tests/adapter/basic/__init__.py b/dbt-tests-adapter/dbt/tests/adapter/basic/__init__.py similarity index 100% rename from dbt/tests/adapter/basic/__init__.py rename to dbt-tests-adapter/dbt/tests/adapter/basic/__init__.py diff --git a/dbt/tests/adapter/basic/expected_catalog.py b/dbt-tests-adapter/dbt/tests/adapter/basic/expected_catalog.py similarity index 100% rename from dbt/tests/adapter/basic/expected_catalog.py rename to dbt-tests-adapter/dbt/tests/adapter/basic/expected_catalog.py diff --git a/dbt/tests/adapter/basic/files.py b/dbt-tests-adapter/dbt/tests/adapter/basic/files.py similarity index 100% rename from dbt/tests/adapter/basic/files.py rename to dbt-tests-adapter/dbt/tests/adapter/basic/files.py diff --git a/dbt/tests/adapter/basic/test_adapter_methods.py b/dbt-tests-adapter/dbt/tests/adapter/basic/test_adapter_methods.py similarity index 100% rename from dbt/tests/adapter/basic/test_adapter_methods.py rename to dbt-tests-adapter/dbt/tests/adapter/basic/test_adapter_methods.py diff --git a/dbt/tests/adapter/basic/test_base.py b/dbt-tests-adapter/dbt/tests/adapter/basic/test_base.py similarity index 100% rename from dbt/tests/adapter/basic/test_base.py rename to dbt-tests-adapter/dbt/tests/adapter/basic/test_base.py diff --git a/dbt/tests/adapter/basic/test_docs_generate.py b/dbt-tests-adapter/dbt/tests/adapter/basic/test_docs_generate.py similarity index 100% rename from dbt/tests/adapter/basic/test_docs_generate.py rename to dbt-tests-adapter/dbt/tests/adapter/basic/test_docs_generate.py diff --git a/dbt/tests/adapter/basic/test_empty.py b/dbt-tests-adapter/dbt/tests/adapter/basic/test_empty.py similarity index 100% rename from dbt/tests/adapter/basic/test_empty.py rename to dbt-tests-adapter/dbt/tests/adapter/basic/test_empty.py diff --git a/dbt/tests/adapter/basic/test_ephemeral.py b/dbt-tests-adapter/dbt/tests/adapter/basic/test_ephemeral.py similarity index 100% rename from dbt/tests/adapter/basic/test_ephemeral.py rename to dbt-tests-adapter/dbt/tests/adapter/basic/test_ephemeral.py diff --git a/dbt/tests/adapter/basic/test_generic_tests.py b/dbt-tests-adapter/dbt/tests/adapter/basic/test_generic_tests.py similarity index 100% rename from dbt/tests/adapter/basic/test_generic_tests.py rename to dbt-tests-adapter/dbt/tests/adapter/basic/test_generic_tests.py diff --git a/dbt/tests/adapter/basic/test_incremental.py b/dbt-tests-adapter/dbt/tests/adapter/basic/test_incremental.py similarity index 100% rename from dbt/tests/adapter/basic/test_incremental.py rename to dbt-tests-adapter/dbt/tests/adapter/basic/test_incremental.py diff --git a/dbt/tests/adapter/basic/test_singular_tests.py b/dbt-tests-adapter/dbt/tests/adapter/basic/test_singular_tests.py similarity index 100% rename from dbt/tests/adapter/basic/test_singular_tests.py rename to dbt-tests-adapter/dbt/tests/adapter/basic/test_singular_tests.py diff --git a/dbt/tests/adapter/basic/test_singular_tests_ephemeral.py b/dbt-tests-adapter/dbt/tests/adapter/basic/test_singular_tests_ephemeral.py similarity index 100% rename from dbt/tests/adapter/basic/test_singular_tests_ephemeral.py rename to dbt-tests-adapter/dbt/tests/adapter/basic/test_singular_tests_ephemeral.py diff --git a/dbt/tests/adapter/basic/test_snapshot_check_cols.py b/dbt-tests-adapter/dbt/tests/adapter/basic/test_snapshot_check_cols.py similarity index 100% rename from dbt/tests/adapter/basic/test_snapshot_check_cols.py rename to dbt-tests-adapter/dbt/tests/adapter/basic/test_snapshot_check_cols.py diff --git a/dbt/tests/adapter/basic/test_snapshot_timestamp.py b/dbt-tests-adapter/dbt/tests/adapter/basic/test_snapshot_timestamp.py similarity index 100% rename from dbt/tests/adapter/basic/test_snapshot_timestamp.py rename to dbt-tests-adapter/dbt/tests/adapter/basic/test_snapshot_timestamp.py diff --git a/dbt/tests/adapter/basic/test_table_materialization.py b/dbt-tests-adapter/dbt/tests/adapter/basic/test_table_materialization.py similarity index 100% rename from dbt/tests/adapter/basic/test_table_materialization.py rename to dbt-tests-adapter/dbt/tests/adapter/basic/test_table_materialization.py diff --git a/dbt/tests/adapter/basic/test_validate_connection.py b/dbt-tests-adapter/dbt/tests/adapter/basic/test_validate_connection.py similarity index 100% rename from dbt/tests/adapter/basic/test_validate_connection.py rename to dbt-tests-adapter/dbt/tests/adapter/basic/test_validate_connection.py diff --git a/dbt/tests/adapter/caching/test_caching.py b/dbt-tests-adapter/dbt/tests/adapter/caching/test_caching.py similarity index 100% rename from dbt/tests/adapter/caching/test_caching.py rename to dbt-tests-adapter/dbt/tests/adapter/caching/test_caching.py diff --git a/dbt/tests/adapter/catalog/files.py b/dbt-tests-adapter/dbt/tests/adapter/catalog/files.py similarity index 100% rename from dbt/tests/adapter/catalog/files.py rename to dbt-tests-adapter/dbt/tests/adapter/catalog/files.py diff --git a/dbt/tests/adapter/catalog/relation_types.py b/dbt-tests-adapter/dbt/tests/adapter/catalog/relation_types.py similarity index 100% rename from dbt/tests/adapter/catalog/relation_types.py rename to dbt-tests-adapter/dbt/tests/adapter/catalog/relation_types.py diff --git a/dbt/tests/adapter/column_types/fixtures.py b/dbt-tests-adapter/dbt/tests/adapter/column_types/fixtures.py similarity index 100% rename from dbt/tests/adapter/column_types/fixtures.py rename to dbt-tests-adapter/dbt/tests/adapter/column_types/fixtures.py diff --git a/dbt/tests/adapter/column_types/test_column_types.py b/dbt-tests-adapter/dbt/tests/adapter/column_types/test_column_types.py similarity index 100% rename from dbt/tests/adapter/column_types/test_column_types.py rename to dbt-tests-adapter/dbt/tests/adapter/column_types/test_column_types.py diff --git a/dbt/tests/adapter/concurrency/test_concurrency.py b/dbt-tests-adapter/dbt/tests/adapter/concurrency/test_concurrency.py similarity index 100% rename from dbt/tests/adapter/concurrency/test_concurrency.py rename to dbt-tests-adapter/dbt/tests/adapter/concurrency/test_concurrency.py diff --git a/dbt/tests/adapter/constraints/fixtures.py b/dbt-tests-adapter/dbt/tests/adapter/constraints/fixtures.py similarity index 100% rename from dbt/tests/adapter/constraints/fixtures.py rename to dbt-tests-adapter/dbt/tests/adapter/constraints/fixtures.py diff --git a/dbt/tests/adapter/constraints/test_constraints.py b/dbt-tests-adapter/dbt/tests/adapter/constraints/test_constraints.py similarity index 100% rename from dbt/tests/adapter/constraints/test_constraints.py rename to dbt-tests-adapter/dbt/tests/adapter/constraints/test_constraints.py diff --git a/dbt/tests/adapter/dbt_clone/fixtures.py b/dbt-tests-adapter/dbt/tests/adapter/dbt_clone/fixtures.py similarity index 100% rename from dbt/tests/adapter/dbt_clone/fixtures.py rename to dbt-tests-adapter/dbt/tests/adapter/dbt_clone/fixtures.py diff --git a/dbt/tests/adapter/dbt_clone/test_dbt_clone.py b/dbt-tests-adapter/dbt/tests/adapter/dbt_clone/test_dbt_clone.py similarity index 100% rename from dbt/tests/adapter/dbt_clone/test_dbt_clone.py rename to dbt-tests-adapter/dbt/tests/adapter/dbt_clone/test_dbt_clone.py diff --git a/dbt/tests/adapter/dbt_debug/test_dbt_debug.py b/dbt-tests-adapter/dbt/tests/adapter/dbt_debug/test_dbt_debug.py similarity index 100% rename from dbt/tests/adapter/dbt_debug/test_dbt_debug.py rename to dbt-tests-adapter/dbt/tests/adapter/dbt_debug/test_dbt_debug.py diff --git a/dbt/tests/adapter/dbt_show/fixtures.py b/dbt-tests-adapter/dbt/tests/adapter/dbt_show/fixtures.py similarity index 100% rename from dbt/tests/adapter/dbt_show/fixtures.py rename to dbt-tests-adapter/dbt/tests/adapter/dbt_show/fixtures.py diff --git a/dbt/tests/adapter/dbt_show/test_dbt_show.py b/dbt-tests-adapter/dbt/tests/adapter/dbt_show/test_dbt_show.py similarity index 100% rename from dbt/tests/adapter/dbt_show/test_dbt_show.py rename to dbt-tests-adapter/dbt/tests/adapter/dbt_show/test_dbt_show.py diff --git a/dbt/tests/adapter/empty/test_empty.py b/dbt-tests-adapter/dbt/tests/adapter/empty/test_empty.py similarity index 100% rename from dbt/tests/adapter/empty/test_empty.py rename to dbt-tests-adapter/dbt/tests/adapter/empty/test_empty.py diff --git a/dbt/tests/adapter/ephemeral/test_ephemeral.py b/dbt-tests-adapter/dbt/tests/adapter/ephemeral/test_ephemeral.py similarity index 100% rename from dbt/tests/adapter/ephemeral/test_ephemeral.py rename to dbt-tests-adapter/dbt/tests/adapter/ephemeral/test_ephemeral.py diff --git a/dbt/tests/adapter/grants/base_grants.py b/dbt-tests-adapter/dbt/tests/adapter/grants/base_grants.py similarity index 100% rename from dbt/tests/adapter/grants/base_grants.py rename to dbt-tests-adapter/dbt/tests/adapter/grants/base_grants.py diff --git a/dbt/tests/adapter/grants/test_incremental_grants.py b/dbt-tests-adapter/dbt/tests/adapter/grants/test_incremental_grants.py similarity index 100% rename from dbt/tests/adapter/grants/test_incremental_grants.py rename to dbt-tests-adapter/dbt/tests/adapter/grants/test_incremental_grants.py diff --git a/dbt/tests/adapter/grants/test_invalid_grants.py b/dbt-tests-adapter/dbt/tests/adapter/grants/test_invalid_grants.py similarity index 100% rename from dbt/tests/adapter/grants/test_invalid_grants.py rename to dbt-tests-adapter/dbt/tests/adapter/grants/test_invalid_grants.py diff --git a/dbt/tests/adapter/grants/test_model_grants.py b/dbt-tests-adapter/dbt/tests/adapter/grants/test_model_grants.py similarity index 100% rename from dbt/tests/adapter/grants/test_model_grants.py rename to dbt-tests-adapter/dbt/tests/adapter/grants/test_model_grants.py diff --git a/dbt/tests/adapter/grants/test_seed_grants.py b/dbt-tests-adapter/dbt/tests/adapter/grants/test_seed_grants.py similarity index 100% rename from dbt/tests/adapter/grants/test_seed_grants.py rename to dbt-tests-adapter/dbt/tests/adapter/grants/test_seed_grants.py diff --git a/dbt/tests/adapter/grants/test_snapshot_grants.py b/dbt-tests-adapter/dbt/tests/adapter/grants/test_snapshot_grants.py similarity index 100% rename from dbt/tests/adapter/grants/test_snapshot_grants.py rename to dbt-tests-adapter/dbt/tests/adapter/grants/test_snapshot_grants.py diff --git a/dbt/tests/adapter/hooks/data/seed_model.sql b/dbt-tests-adapter/dbt/tests/adapter/hooks/data/seed_model.sql similarity index 100% rename from dbt/tests/adapter/hooks/data/seed_model.sql rename to dbt-tests-adapter/dbt/tests/adapter/hooks/data/seed_model.sql diff --git a/dbt/tests/adapter/hooks/data/seed_run.sql b/dbt-tests-adapter/dbt/tests/adapter/hooks/data/seed_run.sql similarity index 100% rename from dbt/tests/adapter/hooks/data/seed_run.sql rename to dbt-tests-adapter/dbt/tests/adapter/hooks/data/seed_run.sql diff --git a/dbt/tests/adapter/hooks/fixtures.py b/dbt-tests-adapter/dbt/tests/adapter/hooks/fixtures.py similarity index 100% rename from dbt/tests/adapter/hooks/fixtures.py rename to dbt-tests-adapter/dbt/tests/adapter/hooks/fixtures.py diff --git a/dbt/tests/adapter/hooks/test_model_hooks.py b/dbt-tests-adapter/dbt/tests/adapter/hooks/test_model_hooks.py similarity index 100% rename from dbt/tests/adapter/hooks/test_model_hooks.py rename to dbt-tests-adapter/dbt/tests/adapter/hooks/test_model_hooks.py diff --git a/dbt/tests/adapter/hooks/test_run_hooks.py b/dbt-tests-adapter/dbt/tests/adapter/hooks/test_run_hooks.py similarity index 100% rename from dbt/tests/adapter/hooks/test_run_hooks.py rename to dbt-tests-adapter/dbt/tests/adapter/hooks/test_run_hooks.py diff --git a/dbt/tests/adapter/incremental/fixtures.py b/dbt-tests-adapter/dbt/tests/adapter/incremental/fixtures.py similarity index 100% rename from dbt/tests/adapter/incremental/fixtures.py rename to dbt-tests-adapter/dbt/tests/adapter/incremental/fixtures.py diff --git a/dbt/tests/adapter/incremental/test_incremental_merge_exclude_columns.py b/dbt-tests-adapter/dbt/tests/adapter/incremental/test_incremental_merge_exclude_columns.py similarity index 100% rename from dbt/tests/adapter/incremental/test_incremental_merge_exclude_columns.py rename to dbt-tests-adapter/dbt/tests/adapter/incremental/test_incremental_merge_exclude_columns.py diff --git a/dbt/tests/adapter/incremental/test_incremental_on_schema_change.py b/dbt-tests-adapter/dbt/tests/adapter/incremental/test_incremental_on_schema_change.py similarity index 100% rename from dbt/tests/adapter/incremental/test_incremental_on_schema_change.py rename to dbt-tests-adapter/dbt/tests/adapter/incremental/test_incremental_on_schema_change.py diff --git a/dbt/tests/adapter/incremental/test_incremental_predicates.py b/dbt-tests-adapter/dbt/tests/adapter/incremental/test_incremental_predicates.py similarity index 100% rename from dbt/tests/adapter/incremental/test_incremental_predicates.py rename to dbt-tests-adapter/dbt/tests/adapter/incremental/test_incremental_predicates.py diff --git a/dbt/tests/adapter/incremental/test_incremental_unique_id.py b/dbt-tests-adapter/dbt/tests/adapter/incremental/test_incremental_unique_id.py similarity index 100% rename from dbt/tests/adapter/incremental/test_incremental_unique_id.py rename to dbt-tests-adapter/dbt/tests/adapter/incremental/test_incremental_unique_id.py diff --git a/dbt/tests/adapter/materialized_view/basic.py b/dbt-tests-adapter/dbt/tests/adapter/materialized_view/basic.py similarity index 100% rename from dbt/tests/adapter/materialized_view/basic.py rename to dbt-tests-adapter/dbt/tests/adapter/materialized_view/basic.py diff --git a/dbt/tests/adapter/materialized_view/changes.py b/dbt-tests-adapter/dbt/tests/adapter/materialized_view/changes.py similarity index 100% rename from dbt/tests/adapter/materialized_view/changes.py rename to dbt-tests-adapter/dbt/tests/adapter/materialized_view/changes.py diff --git a/dbt/tests/adapter/materialized_view/files.py b/dbt-tests-adapter/dbt/tests/adapter/materialized_view/files.py similarity index 100% rename from dbt/tests/adapter/materialized_view/files.py rename to dbt-tests-adapter/dbt/tests/adapter/materialized_view/files.py diff --git a/dbt/tests/adapter/persist_docs/fixtures.py b/dbt-tests-adapter/dbt/tests/adapter/persist_docs/fixtures.py similarity index 100% rename from dbt/tests/adapter/persist_docs/fixtures.py rename to dbt-tests-adapter/dbt/tests/adapter/persist_docs/fixtures.py diff --git a/dbt/tests/adapter/persist_docs/test_persist_docs.py b/dbt-tests-adapter/dbt/tests/adapter/persist_docs/test_persist_docs.py similarity index 100% rename from dbt/tests/adapter/persist_docs/test_persist_docs.py rename to dbt-tests-adapter/dbt/tests/adapter/persist_docs/test_persist_docs.py diff --git a/dbt/tests/adapter/python_model/test_python_model.py b/dbt-tests-adapter/dbt/tests/adapter/python_model/test_python_model.py similarity index 100% rename from dbt/tests/adapter/python_model/test_python_model.py rename to dbt-tests-adapter/dbt/tests/adapter/python_model/test_python_model.py diff --git a/dbt/tests/adapter/python_model/test_spark.py b/dbt-tests-adapter/dbt/tests/adapter/python_model/test_spark.py similarity index 100% rename from dbt/tests/adapter/python_model/test_spark.py rename to dbt-tests-adapter/dbt/tests/adapter/python_model/test_spark.py diff --git a/dbt/tests/adapter/query_comment/fixtures.py b/dbt-tests-adapter/dbt/tests/adapter/query_comment/fixtures.py similarity index 100% rename from dbt/tests/adapter/query_comment/fixtures.py rename to dbt-tests-adapter/dbt/tests/adapter/query_comment/fixtures.py diff --git a/dbt/tests/adapter/query_comment/test_query_comment.py b/dbt-tests-adapter/dbt/tests/adapter/query_comment/test_query_comment.py similarity index 100% rename from dbt/tests/adapter/query_comment/test_query_comment.py rename to dbt-tests-adapter/dbt/tests/adapter/query_comment/test_query_comment.py diff --git a/dbt/tests/adapter/relations/test_changing_relation_type.py b/dbt-tests-adapter/dbt/tests/adapter/relations/test_changing_relation_type.py similarity index 100% rename from dbt/tests/adapter/relations/test_changing_relation_type.py rename to dbt-tests-adapter/dbt/tests/adapter/relations/test_changing_relation_type.py diff --git a/dbt/tests/adapter/relations/test_dropping_schema_named.py b/dbt-tests-adapter/dbt/tests/adapter/relations/test_dropping_schema_named.py similarity index 100% rename from dbt/tests/adapter/relations/test_dropping_schema_named.py rename to dbt-tests-adapter/dbt/tests/adapter/relations/test_dropping_schema_named.py diff --git a/dbt/tests/adapter/simple_copy/fixtures.py b/dbt-tests-adapter/dbt/tests/adapter/simple_copy/fixtures.py similarity index 100% rename from dbt/tests/adapter/simple_copy/fixtures.py rename to dbt-tests-adapter/dbt/tests/adapter/simple_copy/fixtures.py diff --git a/dbt/tests/adapter/simple_copy/test_copy_uppercase.py b/dbt-tests-adapter/dbt/tests/adapter/simple_copy/test_copy_uppercase.py similarity index 100% rename from dbt/tests/adapter/simple_copy/test_copy_uppercase.py rename to dbt-tests-adapter/dbt/tests/adapter/simple_copy/test_copy_uppercase.py diff --git a/dbt/tests/adapter/simple_copy/test_simple_copy.py b/dbt-tests-adapter/dbt/tests/adapter/simple_copy/test_simple_copy.py similarity index 100% rename from dbt/tests/adapter/simple_copy/test_simple_copy.py rename to dbt-tests-adapter/dbt/tests/adapter/simple_copy/test_simple_copy.py diff --git a/dbt/tests/adapter/simple_seed/fixtures.py b/dbt-tests-adapter/dbt/tests/adapter/simple_seed/fixtures.py similarity index 100% rename from dbt/tests/adapter/simple_seed/fixtures.py rename to dbt-tests-adapter/dbt/tests/adapter/simple_seed/fixtures.py diff --git a/dbt/tests/adapter/simple_seed/seed_bom.csv b/dbt-tests-adapter/dbt/tests/adapter/simple_seed/seed_bom.csv similarity index 100% rename from dbt/tests/adapter/simple_seed/seed_bom.csv rename to dbt-tests-adapter/dbt/tests/adapter/simple_seed/seed_bom.csv diff --git a/dbt/tests/adapter/simple_seed/seeds.py b/dbt-tests-adapter/dbt/tests/adapter/simple_seed/seeds.py similarity index 100% rename from dbt/tests/adapter/simple_seed/seeds.py rename to dbt-tests-adapter/dbt/tests/adapter/simple_seed/seeds.py diff --git a/dbt/tests/adapter/simple_seed/test_seed.py b/dbt-tests-adapter/dbt/tests/adapter/simple_seed/test_seed.py similarity index 100% rename from dbt/tests/adapter/simple_seed/test_seed.py rename to dbt-tests-adapter/dbt/tests/adapter/simple_seed/test_seed.py diff --git a/dbt/tests/adapter/simple_seed/test_seed_type_override.py b/dbt-tests-adapter/dbt/tests/adapter/simple_seed/test_seed_type_override.py similarity index 100% rename from dbt/tests/adapter/simple_seed/test_seed_type_override.py rename to dbt-tests-adapter/dbt/tests/adapter/simple_seed/test_seed_type_override.py diff --git a/dbt/tests/adapter/simple_snapshot/common.py b/dbt-tests-adapter/dbt/tests/adapter/simple_snapshot/common.py similarity index 100% rename from dbt/tests/adapter/simple_snapshot/common.py rename to dbt-tests-adapter/dbt/tests/adapter/simple_snapshot/common.py diff --git a/dbt/tests/adapter/simple_snapshot/seeds.py b/dbt-tests-adapter/dbt/tests/adapter/simple_snapshot/seeds.py similarity index 100% rename from dbt/tests/adapter/simple_snapshot/seeds.py rename to dbt-tests-adapter/dbt/tests/adapter/simple_snapshot/seeds.py diff --git a/dbt/tests/adapter/simple_snapshot/snapshots.py b/dbt-tests-adapter/dbt/tests/adapter/simple_snapshot/snapshots.py similarity index 100% rename from dbt/tests/adapter/simple_snapshot/snapshots.py rename to dbt-tests-adapter/dbt/tests/adapter/simple_snapshot/snapshots.py diff --git a/dbt/tests/adapter/simple_snapshot/test_snapshot.py b/dbt-tests-adapter/dbt/tests/adapter/simple_snapshot/test_snapshot.py similarity index 100% rename from dbt/tests/adapter/simple_snapshot/test_snapshot.py rename to dbt-tests-adapter/dbt/tests/adapter/simple_snapshot/test_snapshot.py diff --git a/dbt/tests/adapter/store_test_failures_tests/_files.py b/dbt-tests-adapter/dbt/tests/adapter/store_test_failures_tests/_files.py similarity index 100% rename from dbt/tests/adapter/store_test_failures_tests/_files.py rename to dbt-tests-adapter/dbt/tests/adapter/store_test_failures_tests/_files.py diff --git a/dbt/tests/adapter/store_test_failures_tests/basic.py b/dbt-tests-adapter/dbt/tests/adapter/store_test_failures_tests/basic.py similarity index 100% rename from dbt/tests/adapter/store_test_failures_tests/basic.py rename to dbt-tests-adapter/dbt/tests/adapter/store_test_failures_tests/basic.py diff --git a/dbt/tests/adapter/store_test_failures_tests/fixtures.py b/dbt-tests-adapter/dbt/tests/adapter/store_test_failures_tests/fixtures.py similarity index 100% rename from dbt/tests/adapter/store_test_failures_tests/fixtures.py rename to dbt-tests-adapter/dbt/tests/adapter/store_test_failures_tests/fixtures.py diff --git a/dbt/tests/adapter/store_test_failures_tests/test_store_test_failures.py b/dbt-tests-adapter/dbt/tests/adapter/store_test_failures_tests/test_store_test_failures.py similarity index 100% rename from dbt/tests/adapter/store_test_failures_tests/test_store_test_failures.py rename to dbt-tests-adapter/dbt/tests/adapter/store_test_failures_tests/test_store_test_failures.py diff --git a/dbt/tests/adapter/unit_testing/test_case_insensitivity.py b/dbt-tests-adapter/dbt/tests/adapter/unit_testing/test_case_insensitivity.py similarity index 100% rename from dbt/tests/adapter/unit_testing/test_case_insensitivity.py rename to dbt-tests-adapter/dbt/tests/adapter/unit_testing/test_case_insensitivity.py diff --git a/dbt/tests/adapter/unit_testing/test_invalid_input.py b/dbt-tests-adapter/dbt/tests/adapter/unit_testing/test_invalid_input.py similarity index 100% rename from dbt/tests/adapter/unit_testing/test_invalid_input.py rename to dbt-tests-adapter/dbt/tests/adapter/unit_testing/test_invalid_input.py diff --git a/dbt/tests/adapter/unit_testing/test_types.py b/dbt-tests-adapter/dbt/tests/adapter/unit_testing/test_types.py similarity index 100% rename from dbt/tests/adapter/unit_testing/test_types.py rename to dbt-tests-adapter/dbt/tests/adapter/unit_testing/test_types.py diff --git a/dbt/tests/adapter/utils/base_array_utils.py b/dbt-tests-adapter/dbt/tests/adapter/utils/base_array_utils.py similarity index 100% rename from dbt/tests/adapter/utils/base_array_utils.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/base_array_utils.py diff --git a/dbt/tests/adapter/utils/base_utils.py b/dbt-tests-adapter/dbt/tests/adapter/utils/base_utils.py similarity index 100% rename from dbt/tests/adapter/utils/base_utils.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/base_utils.py diff --git a/dbt/tests/adapter/utils/data_types/base_data_type_macro.py b/dbt-tests-adapter/dbt/tests/adapter/utils/data_types/base_data_type_macro.py similarity index 100% rename from dbt/tests/adapter/utils/data_types/base_data_type_macro.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/data_types/base_data_type_macro.py diff --git a/dbt/tests/adapter/utils/data_types/test_type_bigint.py b/dbt-tests-adapter/dbt/tests/adapter/utils/data_types/test_type_bigint.py similarity index 100% rename from dbt/tests/adapter/utils/data_types/test_type_bigint.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/data_types/test_type_bigint.py diff --git a/dbt/tests/adapter/utils/data_types/test_type_boolean.py b/dbt-tests-adapter/dbt/tests/adapter/utils/data_types/test_type_boolean.py similarity index 100% rename from dbt/tests/adapter/utils/data_types/test_type_boolean.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/data_types/test_type_boolean.py diff --git a/dbt/tests/adapter/utils/data_types/test_type_float.py b/dbt-tests-adapter/dbt/tests/adapter/utils/data_types/test_type_float.py similarity index 100% rename from dbt/tests/adapter/utils/data_types/test_type_float.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/data_types/test_type_float.py diff --git a/dbt/tests/adapter/utils/data_types/test_type_int.py b/dbt-tests-adapter/dbt/tests/adapter/utils/data_types/test_type_int.py similarity index 100% rename from dbt/tests/adapter/utils/data_types/test_type_int.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/data_types/test_type_int.py diff --git a/dbt/tests/adapter/utils/data_types/test_type_numeric.py b/dbt-tests-adapter/dbt/tests/adapter/utils/data_types/test_type_numeric.py similarity index 100% rename from dbt/tests/adapter/utils/data_types/test_type_numeric.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/data_types/test_type_numeric.py diff --git a/dbt/tests/adapter/utils/data_types/test_type_string.py b/dbt-tests-adapter/dbt/tests/adapter/utils/data_types/test_type_string.py similarity index 100% rename from dbt/tests/adapter/utils/data_types/test_type_string.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/data_types/test_type_string.py diff --git a/dbt/tests/adapter/utils/data_types/test_type_timestamp.py b/dbt-tests-adapter/dbt/tests/adapter/utils/data_types/test_type_timestamp.py similarity index 100% rename from dbt/tests/adapter/utils/data_types/test_type_timestamp.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/data_types/test_type_timestamp.py diff --git a/dbt/tests/adapter/utils/fixture_any_value.py b/dbt-tests-adapter/dbt/tests/adapter/utils/fixture_any_value.py similarity index 100% rename from dbt/tests/adapter/utils/fixture_any_value.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/fixture_any_value.py diff --git a/dbt/tests/adapter/utils/fixture_array_append.py b/dbt-tests-adapter/dbt/tests/adapter/utils/fixture_array_append.py similarity index 100% rename from dbt/tests/adapter/utils/fixture_array_append.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/fixture_array_append.py diff --git a/dbt/tests/adapter/utils/fixture_array_concat.py b/dbt-tests-adapter/dbt/tests/adapter/utils/fixture_array_concat.py similarity index 100% rename from dbt/tests/adapter/utils/fixture_array_concat.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/fixture_array_concat.py diff --git a/dbt/tests/adapter/utils/fixture_array_construct.py b/dbt-tests-adapter/dbt/tests/adapter/utils/fixture_array_construct.py similarity index 100% rename from dbt/tests/adapter/utils/fixture_array_construct.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/fixture_array_construct.py diff --git a/dbt/tests/adapter/utils/fixture_bool_or.py b/dbt-tests-adapter/dbt/tests/adapter/utils/fixture_bool_or.py similarity index 100% rename from dbt/tests/adapter/utils/fixture_bool_or.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/fixture_bool_or.py diff --git a/dbt/tests/adapter/utils/fixture_cast_bool_to_text.py b/dbt-tests-adapter/dbt/tests/adapter/utils/fixture_cast_bool_to_text.py similarity index 100% rename from dbt/tests/adapter/utils/fixture_cast_bool_to_text.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/fixture_cast_bool_to_text.py diff --git a/dbt/tests/adapter/utils/fixture_concat.py b/dbt-tests-adapter/dbt/tests/adapter/utils/fixture_concat.py similarity index 100% rename from dbt/tests/adapter/utils/fixture_concat.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/fixture_concat.py diff --git a/dbt/tests/adapter/utils/fixture_date_spine.py b/dbt-tests-adapter/dbt/tests/adapter/utils/fixture_date_spine.py similarity index 100% rename from dbt/tests/adapter/utils/fixture_date_spine.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/fixture_date_spine.py diff --git a/dbt/tests/adapter/utils/fixture_date_trunc.py b/dbt-tests-adapter/dbt/tests/adapter/utils/fixture_date_trunc.py similarity index 100% rename from dbt/tests/adapter/utils/fixture_date_trunc.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/fixture_date_trunc.py diff --git a/dbt/tests/adapter/utils/fixture_dateadd.py b/dbt-tests-adapter/dbt/tests/adapter/utils/fixture_dateadd.py similarity index 100% rename from dbt/tests/adapter/utils/fixture_dateadd.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/fixture_dateadd.py diff --git a/dbt/tests/adapter/utils/fixture_datediff.py b/dbt-tests-adapter/dbt/tests/adapter/utils/fixture_datediff.py similarity index 100% rename from dbt/tests/adapter/utils/fixture_datediff.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/fixture_datediff.py diff --git a/dbt/tests/adapter/utils/fixture_equals.py b/dbt-tests-adapter/dbt/tests/adapter/utils/fixture_equals.py similarity index 100% rename from dbt/tests/adapter/utils/fixture_equals.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/fixture_equals.py diff --git a/dbt/tests/adapter/utils/fixture_escape_single_quotes.py b/dbt-tests-adapter/dbt/tests/adapter/utils/fixture_escape_single_quotes.py similarity index 100% rename from dbt/tests/adapter/utils/fixture_escape_single_quotes.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/fixture_escape_single_quotes.py diff --git a/dbt/tests/adapter/utils/fixture_except.py b/dbt-tests-adapter/dbt/tests/adapter/utils/fixture_except.py similarity index 100% rename from dbt/tests/adapter/utils/fixture_except.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/fixture_except.py diff --git a/dbt/tests/adapter/utils/fixture_generate_series.py b/dbt-tests-adapter/dbt/tests/adapter/utils/fixture_generate_series.py similarity index 100% rename from dbt/tests/adapter/utils/fixture_generate_series.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/fixture_generate_series.py diff --git a/dbt/tests/adapter/utils/fixture_get_intervals_between.py b/dbt-tests-adapter/dbt/tests/adapter/utils/fixture_get_intervals_between.py similarity index 100% rename from dbt/tests/adapter/utils/fixture_get_intervals_between.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/fixture_get_intervals_between.py diff --git a/dbt/tests/adapter/utils/fixture_get_powers_of_two.py b/dbt-tests-adapter/dbt/tests/adapter/utils/fixture_get_powers_of_two.py similarity index 100% rename from dbt/tests/adapter/utils/fixture_get_powers_of_two.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/fixture_get_powers_of_two.py diff --git a/dbt/tests/adapter/utils/fixture_hash.py b/dbt-tests-adapter/dbt/tests/adapter/utils/fixture_hash.py similarity index 100% rename from dbt/tests/adapter/utils/fixture_hash.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/fixture_hash.py diff --git a/dbt/tests/adapter/utils/fixture_intersect.py b/dbt-tests-adapter/dbt/tests/adapter/utils/fixture_intersect.py similarity index 100% rename from dbt/tests/adapter/utils/fixture_intersect.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/fixture_intersect.py diff --git a/dbt/tests/adapter/utils/fixture_last_day.py b/dbt-tests-adapter/dbt/tests/adapter/utils/fixture_last_day.py similarity index 100% rename from dbt/tests/adapter/utils/fixture_last_day.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/fixture_last_day.py diff --git a/dbt/tests/adapter/utils/fixture_length.py b/dbt-tests-adapter/dbt/tests/adapter/utils/fixture_length.py similarity index 100% rename from dbt/tests/adapter/utils/fixture_length.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/fixture_length.py diff --git a/dbt/tests/adapter/utils/fixture_listagg.py b/dbt-tests-adapter/dbt/tests/adapter/utils/fixture_listagg.py similarity index 100% rename from dbt/tests/adapter/utils/fixture_listagg.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/fixture_listagg.py diff --git a/dbt/tests/adapter/utils/fixture_null_compare.py b/dbt-tests-adapter/dbt/tests/adapter/utils/fixture_null_compare.py similarity index 100% rename from dbt/tests/adapter/utils/fixture_null_compare.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/fixture_null_compare.py diff --git a/dbt/tests/adapter/utils/fixture_position.py b/dbt-tests-adapter/dbt/tests/adapter/utils/fixture_position.py similarity index 100% rename from dbt/tests/adapter/utils/fixture_position.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/fixture_position.py diff --git a/dbt/tests/adapter/utils/fixture_replace.py b/dbt-tests-adapter/dbt/tests/adapter/utils/fixture_replace.py similarity index 100% rename from dbt/tests/adapter/utils/fixture_replace.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/fixture_replace.py diff --git a/dbt/tests/adapter/utils/fixture_right.py b/dbt-tests-adapter/dbt/tests/adapter/utils/fixture_right.py similarity index 100% rename from dbt/tests/adapter/utils/fixture_right.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/fixture_right.py diff --git a/dbt/tests/adapter/utils/fixture_safe_cast.py b/dbt-tests-adapter/dbt/tests/adapter/utils/fixture_safe_cast.py similarity index 100% rename from dbt/tests/adapter/utils/fixture_safe_cast.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/fixture_safe_cast.py diff --git a/dbt/tests/adapter/utils/fixture_split_part.py b/dbt-tests-adapter/dbt/tests/adapter/utils/fixture_split_part.py similarity index 100% rename from dbt/tests/adapter/utils/fixture_split_part.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/fixture_split_part.py diff --git a/dbt/tests/adapter/utils/fixture_string_literal.py b/dbt-tests-adapter/dbt/tests/adapter/utils/fixture_string_literal.py similarity index 100% rename from dbt/tests/adapter/utils/fixture_string_literal.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/fixture_string_literal.py diff --git a/dbt/tests/adapter/utils/test_any_value.py b/dbt-tests-adapter/dbt/tests/adapter/utils/test_any_value.py similarity index 100% rename from dbt/tests/adapter/utils/test_any_value.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/test_any_value.py diff --git a/dbt/tests/adapter/utils/test_array_append.py b/dbt-tests-adapter/dbt/tests/adapter/utils/test_array_append.py similarity index 100% rename from dbt/tests/adapter/utils/test_array_append.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/test_array_append.py diff --git a/dbt/tests/adapter/utils/test_array_concat.py b/dbt-tests-adapter/dbt/tests/adapter/utils/test_array_concat.py similarity index 100% rename from dbt/tests/adapter/utils/test_array_concat.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/test_array_concat.py diff --git a/dbt/tests/adapter/utils/test_array_construct.py b/dbt-tests-adapter/dbt/tests/adapter/utils/test_array_construct.py similarity index 100% rename from dbt/tests/adapter/utils/test_array_construct.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/test_array_construct.py diff --git a/dbt/tests/adapter/utils/test_bool_or.py b/dbt-tests-adapter/dbt/tests/adapter/utils/test_bool_or.py similarity index 100% rename from dbt/tests/adapter/utils/test_bool_or.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/test_bool_or.py diff --git a/dbt/tests/adapter/utils/test_cast_bool_to_text.py b/dbt-tests-adapter/dbt/tests/adapter/utils/test_cast_bool_to_text.py similarity index 100% rename from dbt/tests/adapter/utils/test_cast_bool_to_text.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/test_cast_bool_to_text.py diff --git a/dbt/tests/adapter/utils/test_concat.py b/dbt-tests-adapter/dbt/tests/adapter/utils/test_concat.py similarity index 100% rename from dbt/tests/adapter/utils/test_concat.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/test_concat.py diff --git a/dbt/tests/adapter/utils/test_current_timestamp.py b/dbt-tests-adapter/dbt/tests/adapter/utils/test_current_timestamp.py similarity index 100% rename from dbt/tests/adapter/utils/test_current_timestamp.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/test_current_timestamp.py diff --git a/dbt/tests/adapter/utils/test_date_spine.py b/dbt-tests-adapter/dbt/tests/adapter/utils/test_date_spine.py similarity index 100% rename from dbt/tests/adapter/utils/test_date_spine.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/test_date_spine.py diff --git a/dbt/tests/adapter/utils/test_date_trunc.py b/dbt-tests-adapter/dbt/tests/adapter/utils/test_date_trunc.py similarity index 100% rename from dbt/tests/adapter/utils/test_date_trunc.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/test_date_trunc.py diff --git a/dbt/tests/adapter/utils/test_dateadd.py b/dbt-tests-adapter/dbt/tests/adapter/utils/test_dateadd.py similarity index 100% rename from dbt/tests/adapter/utils/test_dateadd.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/test_dateadd.py diff --git a/dbt/tests/adapter/utils/test_datediff.py b/dbt-tests-adapter/dbt/tests/adapter/utils/test_datediff.py similarity index 100% rename from dbt/tests/adapter/utils/test_datediff.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/test_datediff.py diff --git a/dbt/tests/adapter/utils/test_equals.py b/dbt-tests-adapter/dbt/tests/adapter/utils/test_equals.py similarity index 100% rename from dbt/tests/adapter/utils/test_equals.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/test_equals.py diff --git a/dbt/tests/adapter/utils/test_escape_single_quotes.py b/dbt-tests-adapter/dbt/tests/adapter/utils/test_escape_single_quotes.py similarity index 100% rename from dbt/tests/adapter/utils/test_escape_single_quotes.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/test_escape_single_quotes.py diff --git a/dbt/tests/adapter/utils/test_except.py b/dbt-tests-adapter/dbt/tests/adapter/utils/test_except.py similarity index 100% rename from dbt/tests/adapter/utils/test_except.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/test_except.py diff --git a/dbt/tests/adapter/utils/test_generate_series.py b/dbt-tests-adapter/dbt/tests/adapter/utils/test_generate_series.py similarity index 100% rename from dbt/tests/adapter/utils/test_generate_series.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/test_generate_series.py diff --git a/dbt/tests/adapter/utils/test_get_intervals_between.py b/dbt-tests-adapter/dbt/tests/adapter/utils/test_get_intervals_between.py similarity index 100% rename from dbt/tests/adapter/utils/test_get_intervals_between.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/test_get_intervals_between.py diff --git a/dbt/tests/adapter/utils/test_get_powers_of_two.py b/dbt-tests-adapter/dbt/tests/adapter/utils/test_get_powers_of_two.py similarity index 100% rename from dbt/tests/adapter/utils/test_get_powers_of_two.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/test_get_powers_of_two.py diff --git a/dbt/tests/adapter/utils/test_hash.py b/dbt-tests-adapter/dbt/tests/adapter/utils/test_hash.py similarity index 100% rename from dbt/tests/adapter/utils/test_hash.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/test_hash.py diff --git a/dbt/tests/adapter/utils/test_intersect.py b/dbt-tests-adapter/dbt/tests/adapter/utils/test_intersect.py similarity index 100% rename from dbt/tests/adapter/utils/test_intersect.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/test_intersect.py diff --git a/dbt/tests/adapter/utils/test_last_day.py b/dbt-tests-adapter/dbt/tests/adapter/utils/test_last_day.py similarity index 100% rename from dbt/tests/adapter/utils/test_last_day.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/test_last_day.py diff --git a/dbt/tests/adapter/utils/test_length.py b/dbt-tests-adapter/dbt/tests/adapter/utils/test_length.py similarity index 100% rename from dbt/tests/adapter/utils/test_length.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/test_length.py diff --git a/dbt/tests/adapter/utils/test_listagg.py b/dbt-tests-adapter/dbt/tests/adapter/utils/test_listagg.py similarity index 100% rename from dbt/tests/adapter/utils/test_listagg.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/test_listagg.py diff --git a/dbt/tests/adapter/utils/test_null_compare.py b/dbt-tests-adapter/dbt/tests/adapter/utils/test_null_compare.py similarity index 100% rename from dbt/tests/adapter/utils/test_null_compare.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/test_null_compare.py diff --git a/dbt/tests/adapter/utils/test_position.py b/dbt-tests-adapter/dbt/tests/adapter/utils/test_position.py similarity index 100% rename from dbt/tests/adapter/utils/test_position.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/test_position.py diff --git a/dbt/tests/adapter/utils/test_replace.py b/dbt-tests-adapter/dbt/tests/adapter/utils/test_replace.py similarity index 100% rename from dbt/tests/adapter/utils/test_replace.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/test_replace.py diff --git a/dbt/tests/adapter/utils/test_right.py b/dbt-tests-adapter/dbt/tests/adapter/utils/test_right.py similarity index 100% rename from dbt/tests/adapter/utils/test_right.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/test_right.py diff --git a/dbt/tests/adapter/utils/test_safe_cast.py b/dbt-tests-adapter/dbt/tests/adapter/utils/test_safe_cast.py similarity index 100% rename from dbt/tests/adapter/utils/test_safe_cast.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/test_safe_cast.py diff --git a/dbt/tests/adapter/utils/test_split_part.py b/dbt-tests-adapter/dbt/tests/adapter/utils/test_split_part.py similarity index 100% rename from dbt/tests/adapter/utils/test_split_part.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/test_split_part.py diff --git a/dbt/tests/adapter/utils/test_string_literal.py b/dbt-tests-adapter/dbt/tests/adapter/utils/test_string_literal.py similarity index 100% rename from dbt/tests/adapter/utils/test_string_literal.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/test_string_literal.py diff --git a/dbt/tests/adapter/utils/test_timestamps.py b/dbt-tests-adapter/dbt/tests/adapter/utils/test_timestamps.py similarity index 100% rename from dbt/tests/adapter/utils/test_timestamps.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/test_timestamps.py diff --git a/dbt/tests/adapter/utils/test_validate_sql.py b/dbt-tests-adapter/dbt/tests/adapter/utils/test_validate_sql.py similarity index 100% rename from dbt/tests/adapter/utils/test_validate_sql.py rename to dbt-tests-adapter/dbt/tests/adapter/utils/test_validate_sql.py diff --git a/dbt-tests-adapter/pyproject.toml b/dbt-tests-adapter/pyproject.toml index 990f2d1a..c5df5998 100644 --- a/dbt-tests-adapter/pyproject.toml +++ b/dbt-tests-adapter/pyproject.toml @@ -50,16 +50,14 @@ Changelog = "https://github.com/dbt-labs/dbt-adapters/blob/main/CHANGELOG.md" requires = ["hatchling"] build-backend = "hatchling.build" -[tool.hatch.build.targets.sdist.force-include] -"../dbt/tests" = "dbt/tests" -"../dbt/__init__.py" = "dbt/__init__.py" +[tool.hatch.version] +path = "dbt/tests/__about__.py" -[tool.hatch.build.targets.wheel.force-include] -"../dbt/tests" = "dbt/tests" -"../dbt/__init__.py" = "dbt/__init__.py" +[tool.hatch.build.targets.sdist] +include = ["dbt/tests", "dbt/__init__.py"] -[tool.hatch.version] -path = "../dbt/tests/__about__.py" +[tool.hatch.build.targets.wheel] +include = ["dbt/tests", "dbt/__init__.py"] [tool.hatch.envs.build] detached = true diff --git a/dbt/adapters/__about__.py b/dbt/adapters/__about__.py index 759fdcd7..75d27aae 100644 --- a/dbt/adapters/__about__.py +++ b/dbt/adapters/__about__.py @@ -1 +1 @@ -version = "1.8.0a2" +version = "1.0.0a2" diff --git a/pyproject.toml b/pyproject.toml index ff26c2b6..f9b8b0f7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -142,6 +142,7 @@ files = [ ] exclude = [ "dbt/adapters/events/adapter_types_pb2.py", + "dbt-tests-adapter/dbt/__init__.py", # overlaps with `dbt/__init__.py` as expected for namespaces "venv", ] [[tool.mypy.overrides]] From ec6bfe68aa3eb3618ab9e76467f963f34bf7c07d Mon Sep 17 00:00:00 2001 From: Github Build Bot Date: Fri, 1 Mar 2024 21:52:32 +0000 Subject: [PATCH 8/8] Bumping version to 1.8.0b1 and generate changelog --- .changes/1.8.0-b1.md | 1 + CHANGELOG.md | 2 ++ dbt-tests-adapter/dbt/tests/__about__.py | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 .changes/1.8.0-b1.md diff --git a/.changes/1.8.0-b1.md b/.changes/1.8.0-b1.md new file mode 100644 index 00000000..f2416c3d --- /dev/null +++ b/.changes/1.8.0-b1.md @@ -0,0 +1 @@ +## dbt-adapter 1.8.0-b1 - March 01, 2024 diff --git a/CHANGELOG.md b/CHANGELOG.md index c47b4fed..927477cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), and is generated by [Changie](https://github.com/miniscruff/changie). +## dbt-adapter 1.8.0-b1 - March 01, 2024 + ## dbt-adapter 1.8.0-a2 - February 28, 2024 ## dbt-adapter 1.0.0-b1 - February 27, 2024 diff --git a/dbt-tests-adapter/dbt/tests/__about__.py b/dbt-tests-adapter/dbt/tests/__about__.py index 759fdcd7..6496f3e2 100644 --- a/dbt-tests-adapter/dbt/tests/__about__.py +++ b/dbt-tests-adapter/dbt/tests/__about__.py @@ -1 +1 @@ -version = "1.8.0a2" +version = "1.8.0b1"