-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dependabot/github_actions/actions/setup-pyth…
…on-5
- Loading branch information
Showing
57 changed files
with
175 additions
and
2,628 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Under the Hood | ||
body: Add support for experimental record/replay testing. | ||
time: 2024-07-16T17:24:42.271859-04:00 | ||
custom: | ||
Author: peterallenwebb | ||
Issue: "123" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ | |
# 1. Bump the version if it has not been bumped | ||
# 2. Generate the changelog (via changie) if there is no markdown file for this version | ||
name: "Release prep" | ||
run-name: "Release prep: Generate changelog and bump ${{ inputs.package }} to ${{ inputs.version }} for release to ${{ inputs.deploy-to }}" | ||
run-name: "Release prep: Generate changelog and bump to ${{ inputs.version }} for release to ${{ inputs.deploy-to }}" | ||
on: | ||
workflow_call: | ||
inputs: | ||
|
@@ -219,7 +219,7 @@ jobs: | |
|
||
steps: | ||
- name: "Checkout ${{ github.event.repository.name }}@${{ needs.release-branch.outputs.name }}" | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ needs.release-branch.outputs.name }} | ||
|
||
|
@@ -292,7 +292,7 @@ jobs: | |
|
||
steps: | ||
- name: "Checkout ${{ github.event.repository.name }}@${{ needs.release-branch.outputs.name }}" | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ needs.release-branch.outputs.name }} | ||
|
||
|
@@ -342,7 +342,7 @@ jobs: | |
uses: dbt-labs/dbt-adapters/.github/actions/setup-hatch@main | ||
|
||
- name: "Run unit tests" | ||
run: hatch run unit-tests:all | ||
run: hatch run unit-tests | ||
|
||
integration-tests: | ||
runs-on: ubuntu-latest | ||
|
@@ -387,7 +387,7 @@ jobs: | |
uses: dbt-labs/dbt-adapters/.github/actions/setup-hatch@main | ||
|
||
- name: "Run integration tests" | ||
run: hatch run integration-tests:all | ||
run: hatch run integration-tests | ||
env: | ||
POSTGRES_TEST_HOST: localhost | ||
POSTGRES_TEST_PORT: 5432 | ||
|
@@ -410,7 +410,7 @@ jobs: | |
steps: | ||
- name: "Checkout ${{ github.event.repository.name }}" | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: "Merge changes into ${{ inputs.branch }}" | ||
uses: everlytic/[email protected] | ||
|
@@ -455,7 +455,7 @@ jobs: | |
echo "name=$branch" >> $GITHUB_OUTPUT | ||
- name: "Checkout ${{ github.event.repository.name }}@${{ steps.branch.outputs.name }}" | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ steps.branch.outputs.name }} | ||
|
||
|
@@ -464,6 +464,6 @@ jobs: | |
run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | ||
|
||
# if this is a real release and a release branch was created, delete it | ||
- name: "Delete release branch: ${{ needs.branch.outputs.name }}" | ||
- name: "Delete release branch: ${{ needs.release-branch.outputs.name }}" | ||
if: ${{ inputs.deploy-to == 'prod' && inputs.is-nightly-release == 'false' && needs.release-branch.outputs.name != '' }} | ||
run: git push origin -d ${{ needs.branch.outputs.name }} | ||
run: git push origin -d ${{ needs.release-branch.outputs.name }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from dbt.adapters.postgres.record.cursor.cursor import PostgresRecordReplayCursor | ||
from dbt.adapters.postgres.record.handle import PostgresRecordReplayHandle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from dbt_common.record import record_function | ||
|
||
from dbt.adapters.record import RecordReplayCursor | ||
|
||
from dbt.adapters.postgres.record.cursor.status import CursorGetStatusMessageRecord | ||
|
||
|
||
class PostgresRecordReplayCursor(RecordReplayCursor): | ||
"""A custom extension of RecordReplayCursor that adds the statusmessage | ||
property which is specific to psycopg.""" | ||
|
||
@property | ||
@record_function(CursorGetStatusMessageRecord, method=True, id_field_name="connection_name") | ||
def statusmessage(self): | ||
return self.native_cursor.statusmessage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import dataclasses | ||
from typing import Optional | ||
|
||
from dbt_common.record import Record, Recorder | ||
|
||
|
||
@dataclasses.dataclass | ||
class CursorGetStatusMessageParams: | ||
connection_name: str | ||
|
||
|
||
@dataclasses.dataclass | ||
class CursorGetStatusMessageResult: | ||
msg: Optional[str] | ||
|
||
|
||
@Recorder.register_record_type | ||
class CursorGetStatusMessageRecord(Record): | ||
params_cls = CursorGetStatusMessageParams | ||
result_cls = CursorGetStatusMessageResult | ||
group = "Database" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from dbt.adapters.record import RecordReplayHandle | ||
|
||
from dbt.adapters.postgres.record.cursor.cursor import PostgresRecordReplayCursor | ||
|
||
|
||
class PostgresRecordReplayHandle(RecordReplayHandle): | ||
"""A custom extension of RecordReplayHandle that returns | ||
a psycopg-specific PostgresRecordReplayCursor object.""" | ||
|
||
def cursor(self): | ||
cursor = None if self.native_handle is None else self.native_handle.cursor() | ||
return PostgresRecordReplayCursor(cursor, self.connection) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.