-
Notifications
You must be signed in to change notification settings - Fork 17
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 dbeatty/unknown-data-type-code-8912
- Loading branch information
Showing
12 changed files
with
156 additions
and
28 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,14 @@ | ||
## dbt-postgres 1.8.0-b2 - April 03, 2024 | ||
|
||
### Under the Hood | ||
|
||
* Add unit test for transaction semantics. | ||
|
||
### Dependencies | ||
|
||
* add "no-binary" install option | ||
* Add `dbt-core` as a dependency to preserve backwards compatibility for installation | ||
|
||
### Security | ||
|
||
* Pin `black>=24.3` in `pyproject.toml` |
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: Dependencies | ||
body: add "no-binary" install option | ||
time: 2024-03-28T13:35:07.300121-07:00 | ||
custom: | ||
Author: colin-rogers-dbt | ||
Issue: "6" |
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: Dependencies | ||
body: Add `dbt-core` as a dependency to preserve backwards compatibility for installation | ||
time: 2024-04-03T13:59:02.539298-04:00 | ||
custom: | ||
Author: mikealfare | ||
Issue: "44" |
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: Security | ||
body: Pin `black>=24.3` in `pyproject.toml` | ||
time: 2024-03-27T19:39:42.633016-04:00 | ||
custom: | ||
Author: mikealfare | ||
Issue: "40" |
File renamed without changes.
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,28 @@ | ||
# **what?** | ||
# This workflow will take the new version number to bump to. With that | ||
# it will run versionbump to update the version number everywhere in the | ||
# code base and then run changie to create the corresponding changelog. | ||
# A PR will be created with the changes that can be reviewed before committing. | ||
|
||
# **why?** | ||
# This is to aid in releasing dbt and making sure we have updated | ||
# the version in all places and generated the changelog. | ||
|
||
# **when?** | ||
# This is triggered manually | ||
|
||
name: Version Bump | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version_number: | ||
description: 'The version number to bump to (ex. 1.2.0, 1.3.0b1)' | ||
required: true | ||
|
||
jobs: | ||
version_bump_and_changie: | ||
uses: dbt-labs/actions/.github/workflows/version-bump.yml@main | ||
with: | ||
version_number: ${{ inputs.version_number }} | ||
secrets: inherit # ok since what we are calling is internally maintained |
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 |
---|---|---|
@@ -1 +1 @@ | ||
version = "1.8.0b1" | ||
version = "1.8.0b2" |
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,56 @@ | ||
import os | ||
from typing import Any, Dict | ||
|
||
from hatchling.builders.config import BuilderConfig | ||
from hatchling.builders.hooks.plugin.interface import BuildHookInterface | ||
from hatchling.plugin import hookimpl | ||
|
||
BASE_DEPS = [ | ||
# psycopg2 dependency installed in custom hatch_build.py | ||
"dbt-adapters>=0.1.0a1,<2.0", | ||
# add dbt-core to ensure backwards compatibility of installation, this is not a functional dependency | ||
"dbt-core>=1.8.0a1", | ||
# installed via dbt-adapters but used directly | ||
"dbt-common>=0.1.0a1,<2.0", | ||
"agate>=1.0,<2.0", | ||
] | ||
|
||
PSYCOPG2_MESSAGE = """ | ||
No package name override was set. | ||
Using 'psycopg2-binary' package to satisfy 'psycopg2' | ||
If you experience segmentation faults, silent crashes, or installation errors, | ||
consider retrying with the 'DBT_PSYCOPG2_NAME' environment variable set to | ||
'psycopg2'. It may require a compiler toolchain and development libraries! | ||
""".strip() | ||
|
||
|
||
def _dbt_psycopg2_name(): | ||
# if the user chose something, use that | ||
package_name = os.getenv("DBT_PSYCOPG2_NAME", "") | ||
if package_name: | ||
return package_name | ||
|
||
# default to psycopg2-binary for all OSes/versions | ||
print(PSYCOPG2_MESSAGE) | ||
return "psycopg2-binary" | ||
|
||
|
||
class CustomBuildHook(BuildHookInterface[BuilderConfig]): | ||
""" | ||
Custom build hook to install psycopg2 instead of psycopg2-binary based on the presence of `DBT_PSYCOPG2_NAME` env | ||
var. This is necessary as psycopg2-binary is better for local development, but psycopg2 is better for production. | ||
""" | ||
|
||
def __init__(self, *args: Any, **kwargs: Any) -> None: | ||
super().__init__(*args, **kwargs) | ||
|
||
def initialize(self, version: str, build_data: Dict) -> None: | ||
build_data["dependencies"] = BASE_DEPS | ||
psycopg2_pkg_name = _dbt_psycopg2_name() | ||
build_data["dependencies"].append(f"{psycopg2_pkg_name}>=2.9,<3.0") | ||
|
||
|
||
@hookimpl | ||
def hatch_register_build_hook(): | ||
return CustomBuildHook |
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