diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml deleted file mode 100644 index 394de1f2..00000000 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ /dev/null @@ -1,81 +0,0 @@ -name: 🐞 Bug -description: Report a bug or an issue you've found with dbt-postgres -title: "[Bug] " -labels: ["bug", "triage"] -body: - - type: markdown - attributes: - value: | - Thanks for taking the time to fill out this bug report! - - type: checkboxes - attributes: - label: Is this a new bug? - description: > - In other words, is this an error, flaw, failure or fault in our software? - - If this is a bug that broke existing functionality that used to work, please open a regression issue. - If this is a bug experienced while using dbt Cloud, please report to [support](mailto:support@getdbt.com). - If this is a request for help or troubleshooting code in your own dbt project, please join our [dbt Community Slack](https://www.getdbt.com/community/join-the-community/) or open a [Discussion question](https://github.com/dbt-labs/docs.getdbt.com/discussions). - - Please search to see if an issue already exists for the bug you encountered. - options: - - label: I believe this is a new bug - required: true - - label: I have searched the existing issues, and I could not find an existing issue for this bug - required: true - - type: textarea - attributes: - label: Current Behavior - description: A concise description of what you're experiencing. - validations: - required: true - - type: textarea - attributes: - label: Expected Behavior - description: A concise description of what you expected to happen. - validations: - required: true - - type: textarea - attributes: - label: Steps To Reproduce - description: Steps to reproduce the behavior. - placeholder: | - 1. In this environment... - 2. With this config... - 3. Run '...' - 4. See error... - validations: - required: true - - type: textarea - id: logs - attributes: - label: Relevant log output - description: | - If applicable, log output to help explain your problem. - render: shell - validations: - required: false - - type: textarea - attributes: - label: Environment - description: | - examples: - - **OS**: Ubuntu 20.04 - - **Python**: 3.11.6 (`python3 --version`) - - **dbt-postgres**: 1.0.0 (`dbt --version`) - value: | - - OS: - - Python: - - dbt-postgres: - render: markdown - validations: - required: false - - type: textarea - attributes: - label: Additional Context - description: | - Links? References? Anything that will give us more context about the issue you are encountering! - - Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. - validations: - required: false diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 8d0995f4..173ab59b 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -7,5 +7,11 @@ contact_links: url: mailto:support@getdbt.com about: Are you using dbt Cloud? Contact our support team for help! - name: Participate in Discussions - url: https://github.com/dbt-labs/dbt-postgres/discussions + url: https://github.com/dbt-labs/dbt-adapters/discussions about: Do you have a Big Idea for dbt-postgres? Read open discussions, or start a new one + - name: Create an issue for dbt-postgres + url: https://github.com/dbt-labs/dbt-adapters/issues/new/choose + about: Report a bug or request a feature for dbt-postgres + - name: Create an issue for dbt-core + url: https://github.com/dbt-labs/dbt-core/issues/new/choose + about: Report a bug or request a feature for dbt-core diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml deleted file mode 100644 index edc32c6c..00000000 --- a/.github/ISSUE_TEMPLATE/feature-request.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: ✨ Feature -description: Propose a straightforward extension of dbt-postgres functionality -title: "[Feature] <title>" -labels: ["enhancement", "triage"] -body: - - type: markdown - attributes: - value: | - Thanks for taking the time to fill out this feature request! - - type: checkboxes - attributes: - label: Is this your first time submitting a feature request? - description: > - We want to make sure that features are distinct and discoverable, - so that other members of the community can find them and offer their thoughts. - - Issues are the right place to request straightforward extensions of existing dbt-postgres functionality. - For "big ideas" about future capabilities of dbt-postgres, we ask that you open a - [discussion](https://github.com/dbt-labs/dbt-postgres/discussions/new?category=ideas) in the "Ideas" category instead. - options: - - label: I have read the [expectations for open source contributors](https://docs.getdbt.com/docs/contributing/oss-expectations) - required: true - - label: I have searched the existing issues, and I could not find an existing issue for this feature - required: true - - label: I am requesting a straightforward extension of existing dbt-postgres functionality, rather than a Big Idea better suited to a discussion - required: true - - type: textarea - attributes: - label: Describe the feature - description: A clear and concise description of what you want to happen. - validations: - required: true - - type: textarea - attributes: - label: Describe alternatives you've considered - description: | - A clear and concise description of any alternative solutions or features you've considered. - validations: - required: false - - type: textarea - attributes: - label: Who will this benefit? - description: | - What kind of use case will this feature be useful for? Please be specific and provide examples, this will help us prioritize properly. - validations: - required: false - - type: input - attributes: - label: Are you interested in contributing this feature? - description: Let us know if you want to write some code, and how we can help. - validations: - required: false - - type: textarea - attributes: - label: Anything else? - description: | - Links? References? Anything that will give us more context about the feature you are suggesting! - validations: - required: false diff --git a/.github/ISSUE_TEMPLATE/regression-report.yml b/.github/ISSUE_TEMPLATE/regression-report.yml deleted file mode 100644 index 73bfbe75..00000000 --- a/.github/ISSUE_TEMPLATE/regression-report.yml +++ /dev/null @@ -1,78 +0,0 @@ -name: ☣️ Regression -description: Report a regression you've observed in a newer version of dbt-postgres -title: "[Regression] <title>" -labels: ["regression", "triage"] -body: - - type: markdown - attributes: - value: | - Thanks for taking the time to fill out this regression report! - - type: checkboxes - attributes: - label: Is this a regression? - description: > - A regression is when documented functionality works as expected in an older version of the software - and no longer works after upgrading to a newer version the software - options: - - label: I believe this is a regression in functionality - required: true - - label: I have searched the existing issues, and I could not find an existing issue for this regression - required: true - - type: textarea - attributes: - label: Current Behavior - description: A concise description of what you're experiencing. - validations: - required: true - - type: textarea - attributes: - label: Expected/Previous Behavior - description: A concise description of what you expected to happen. - validations: - required: true - - type: textarea - attributes: - label: Steps To Reproduce - description: Steps to reproduce the behavior. - placeholder: | - 1. In this environment... - 2. With this config... - 3. Run '...' - 4. See error... - validations: - required: true - - type: textarea - id: logs - attributes: - label: Relevant log output - description: | - If applicable, log output to help explain your problem. - render: shell - validations: - required: false - - type: textarea - attributes: - label: Environment - description: | - examples: - - **OS**: Ubuntu 20.04 - - **Python**: 3.11.6 (`python3 --version`) - - **dbt-postgres (working version)**: 1.1.0 (`dbt --version`) - - **dbt-postgres (regression version)**: 1.2.0 (`dbt --version`) - value: | - - OS: - - Python: - - dbt-postgres (working version): - - dbt-postgres (regression version): - render: markdown - validations: - required: true - - type: textarea - attributes: - label: Additional Context - description: | - Links? References? Anything that will give us more context about the issue you are encountering! - - Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. - validations: - required: false diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 746dcae2..00000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,29 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "pip" - directory: "/" - schedule: - interval: "daily" - rebase-strategy: "disabled" - ignore: - - dependency-name: "*" - update-types: - - version-update:semver-patch - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "weekly" - rebase-strategy: "disabled" - ignore: - - dependency-name: "*" - update-types: - - version-update:semver-patch - - package-ecosystem: "docker" - directory: "/docker" - schedule: - interval: "weekly" - rebase-strategy: "disabled" - ignore: - - dependency-name: "*" - update-types: - - version-update:semver-patch diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 26e27c4d..527ffd36 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,35 +1,3 @@ -resolves # -[docs](https://github.com/dbt-labs/docs.getdbt.com/issues/new/choose) dbt-labs/docs.getdbt.com/# - <!--- - Include the number of the issue addressed by this PR above if applicable. - PRs for code changes without an associated issue *will not be merged*. - See CONTRIBUTING.md for more information. - - Include the number of the docs issue that was opened for this PR. If - this change has no user-facing implications, "N/A" suffices instead. New - docs tickets can be created by clicking the link above or by going to - https://github.com/dbt-labs/docs.getdbt.com/issues/new/choose. + This repository has moved into [dbt-labs/dbt-adapters](https://www.github.com/dbt-labs/dbt-adapters). --> - -### Problem - -<!--- - Describe the problem this PR is solving. What is the application state - before this PR is merged? ---> - -### Solution - -<!--- - Describe the way this PR solves the above problem. Add as much detail as you - can to help reviewers understand your changes. Include any alternatives and - tradeoffs you considered. ---> - -### Checklist - -- [ ] I have read [the contributing guide](https://github.com/dbt-labs/dbt-postgres/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 -- [ ] 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 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9d925156..a98663e1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,232 +1,4 @@ # Contributing to `dbt-postgres` -- [About this document](#about-this-document) -- [Getting the code](#getting-the-code) -- [Developing](#developing) -- [Testing](#testing) -- [Documentation](#documentation) -- [Submitting a pull request](#submitting-a-pull-request) - - -## About this document - -This document is a guide for anyone interested in contributing to `dbt-postgres`. -It outlines how to install `dbt-postgres` for development, -run tests locally, update documentation, and submit pull requests. -This guide assumes users are developing on a Linux or MacOS system. -The following utilities are needed or will be installed in this guide: - -- `pip` -- `virturalenv` -- `git` -- `changie` - -If local functional testing is required, then a database instance -and appropriate credentials are also required. - -In addition to this guide, users are highly encouraged to read the `dbt-core` -[CONTRIBUTING.md](https://github.com/dbt-labs/dbt-core/blob/main/CONTRIBUTING.md). -Almost all information there is applicable here. - - -## Getting the code - -`git` is required to download, modify, and sync the `dbt-postgres` code. -There are several ways to install Git. For MacOS: - -- Install [Xcode](https://developer.apple.com/support/xcode/) -- Install [Xcode Command Line Tools](https://mac.install.guide/commandlinetools/index.html) - -### External contributors - -Contributors external to the `dbt-labs` GitHub organization can contribute to `dbt-postgres` -by forking the `dbt-postgres` repository. For more on forking, check out the -[GitHub docs on forking](https://help.github.com/en/articles/fork-a-repo). To contribute: - -1. Fork the `dbt-labs/dbt-postgres` repository (e.g. `{forked-org}/dbt-postgres`) -2. Clone `{forked-org}/dbt-postgres` locally -3. Check out a new branch locally -4. Make changes in the new branch -5. Push the new branch to `{forked-org}/dbt-postgres` -6. Open a pull request in `dbt-labs/dbt-postgres` to merge `{forked-org}/dbt-postgres/{new-branch}` into `main` - -### dbt Labs contributors - -Contributors in the `dbt Labs` GitHub organization have push access to the `dbt-postgres` repo. -Rather than forking `dbt-labs/dbt-postgres`, use `dbt-labs/dbt-postgres` directly. To contribute: - -1. Clone `dbt-labs/dbt-postgres` locally -2. Check out a new branch locally -3. Make changes in the new branch -4. Push the new branch to `dbt-labs/dbt-postgres` -5. Open a pull request in `dbt-labs/dbt-postgres` to merge `{new-branch}` into `main` - - -## Developing - -### Installation - -1. Ensure the latest versions of `pip` and `hatch` are installed: - ```shell - pip install --user --upgrade pip hatch - ``` -2. This step is optional, but it's recommended. Configure `hatch` to create its virtual environments in the project. Add this block to your `hatch` `config.toml` file: - ```toml - # MacOS: ~/Library/Application Support/hatch/config.toml - [dirs.env] - virtual = ".hatch" - ``` - This makes `hatch` create all virtual environments in the project root inside of the directory `/.hatch`, similar to `/.tox` for `tox`. - It also makes it easier to add this environment as a runner in common IDEs like VSCode and PyCharm. -3. Create a `hatch` environment with all of the development dependencies and activate it: - ```shell - hatch run setup - hatch shell - ``` -4. Run any commands within the virtual environment by prefixing the command with `hatch run`: - ```shell - hatch run <command> - ``` - -When `dbt-postgres` is installed this way, any changes made to the `dbt-postgres` source code -will be reflected in the virtual environment immediately. - -## Testing - -`dbt-postgres` contains [code quality checks](https://github.com/dbt-labs/dbt-postgres/tree/main/.pre-commit-config.yaml), [unit tests](https://github.com/dbt-labs/dbt-postgres/tree/main/tests/unit), -and [functional tests](https://github.com/dbt-labs/dbt-postgres/tree/main/tests/functional). - -### Code quality - -Code quality checks can run with a single command: -```shell -hatch run code-quality -``` - -### Unit tests - -Unit tests can be run locally without setting up a database connection: - -```shell -# Note: replace $strings with valid names - -# run all unit tests -hatch run unit-test - -# run all unit tests in a module -hatch run unit-tests tests/unit/$test_file_name.py - -# run a specific unit test -hatch run unit-tests tests/unit/$test_file_name.py::$test_class_name::$test_method_name -``` - -### Functional tests - -Functional tests require a database to test against. There are two primary ways to run functional tests: - -- Tests will run automatically against a dbt Labs owned database during PR checks -- Tests can be run locally by configuring a `test.env` file with appropriate `ENV` variables: - ```shell - cp test.env.example test.env - $EDITOR test.env - ``` - -> **_WARNING:_** The parameters in `test.env` must link to a valid database. -> `test.env` is git-ignored, but be _extra_ careful to never check in credentials -> or other sensitive information when developing. - -Functional tests can be run locally with a valid database connection configured in `test.env`: - -```shell -# Note: replace $strings with valid names - -# run all functional tests -hatch run integration-tests - -# run all functional tests in a directory -hatch run integration-tests tests/functional/$test_directory - -# run all functional tests in a module -hatch run integration-tests tests/functional/$test_directory/$test_filename.py - -# run all functional tests in a class -hatch run integration-tests tests/functional/$test_directory/$test_filename.py::$test_class_name - -# run a specific functional test -hatch run integration-tests tests/functional/$test_directory/$test_filename.py::$test_class_name::$test__method_name -``` - -### Testing against a development branch - -Some changes require a change in `dbt-common` and/or `dbt-adapters`. -In that case, the dependency on `dbt-common` and/or `dbt-adapters` must be updated to point to the development branch. For example: - -```toml -[tool.hatch.envs.default] -dependencies = [ - "dbt-common @ git+https://github.com/dbt-labs/dbt-common.git@my-dev-branch", - "dbt-adapters @ git+https://github.com/dbt-labs/dbt-adapters.git@my-dev-branch", - "dbt-tests-adapter @ git+https://github.com/dbt-labs/dbt-adapters.git@my-dev-branch#subdirectory=dbt-tests-adapter", - ..., -] -``` - -This will install `dbt-common`/`dbt-adapters`/`dbt-tests-adapter` as snapshots. In other words, if `my-dev-branch` is updated on GitHub, those updates will not be reflected locally. -In order to pick up those updates, the `hatch` environment(s) will need to be rebuilt: - -```shell -exit -hatch env prune -hatch shell -``` - -## Documentation - -### User documentation - -Many changes will require an update to `dbt-postgres` user documentation. -All contributors, whether internal or external, are encouraged to open an issue or PR -in the docs repo when submitting user-facing changes. Here are some relevant links: - -- [User docs](https://docs.getdbt.com/) - - [Warehouse Profile](https://docs.getdbt.com/reference/warehouse-profiles/) - - [Resource Configs](https://docs.getdbt.com/reference/resource-configs/) -- [User docs repo](https://github.com/dbt-labs/docs.getdbt.com) - -### CHANGELOG entry - -`dbt-postgres` uses [changie](https://changie.dev) to generate `CHANGELOG` entries. -Follow the steps to [install `changie`](https://changie.dev/guide/installation/). - -Once changie is installed and the PR is created, run: - ```shell - changie new - ``` -`changie` will walk through the process of creating a changelog entry. -Remember to commit and push the file that's created. - -> **_NOTE:_** Do not edit the `CHANGELOG.md` directly. -> Any modifications will be lost by the consolidation process. - - -## Submitting a pull request - -### Signing the CLA - -> **_NOTE:_** All contributors to `dbt-postgres` must sign the -> [Contributor License Agreement](https://docs.getdbt.com/docs/contributor-license-agreements)(CLA). - -Maintainers will be unable to merge contributions until the contributor signs the CLA. -This is a one time requirement, not a per-PR requirement. -Even without a CLA, anyone is welcome to open issues and comment on existing issues or PRs. - -### Opening a pull request - -A `dbt-postgres` maintainer will be assigned to review each PR based on priority and capacity. -They may suggest code revisions for style and clarity or they may request additional tests. -These are good things! dbt Labs believes that contributing high-quality code is a collaborative effort. -The same process is followed whether the contributor is external or another `dbt-postgres` maintainer. -Once all tests are passing and the PR has been approved by the appropriate code owners, -a `dbt-postgres` maintainer will merge the changes into `main`. - -And that's it! Happy developing :tada: +This repository has moved into [dbt-labs/dbt-adapters](https://www.github.com/dbt-labs/dbt-adapters). +Please refer to that repo for a guide on how to contribute to `dbt-postgres`. diff --git a/README.md b/README.md index 8053af19..71b33343 100644 --- a/README.md +++ b/README.md @@ -1,55 +1,6 @@ <p align="center"> <img src="https://raw.githubusercontent.com/dbt-labs/dbt/ec7dee39f793aa4f7dd3dae37282cc87664813e4/etc/dbt-logo-full.svg" alt="dbt logo" width="500"/> </p> -<p align="center"> - <a href="https://github.com/dbt-labs/dbt-core/actions/workflows/main.yml"> - <img src="https://github.com/dbt-labs/dbt-core/actions/workflows/main.yml/badge.svg?event=push" alt="CI Badge"/> - </a> -</p> - -**[dbt](https://www.getdbt.com/)** enables data analysts and engineers to transform their data using the same practices that software engineers use to build applications. - -dbt is the T in ELT. Organize, cleanse, denormalize, filter, rename, and pre-aggregate the raw data in your warehouse so that it's ready for analysis. - -## dbt-postgres - -The `dbt-postgres` package contains all of the code enabling dbt to work with a Postgres database. For -more information on using dbt with Postgres, consult [the docs](https://docs.getdbt.com/docs/profile-postgres). - -## Getting started - -- [Install dbt](https://docs.getdbt.com/docs/installation) -- Read the [introduction](https://docs.getdbt.com/docs/introduction/) and [viewpoint](https://docs.getdbt.com/docs/about/viewpoint/) - -### `psycopg2-binary` vs. `psycopg2` - -By default, `dbt-postgres` installs `psycopg2-binary`. This is great for development, and even testing, as it does not require any OS dependencies; it's a pre-built wheel. However, building `psycopg2` from source will grant performance improvements that are desired in a production environment. In order to install `psycopg2`, use the following steps: - -```bash -if [[ $(pip show psycopg2-binary) ]]; then - PSYCOPG2_VERSION=$(pip show psycopg2-binary | grep Version | cut -d " " -f 2) - pip uninstall -y psycopg2-binary - pip install psycopg2==$PSYCOPG2_VERSION -fi -``` - -This ensures the version of `psycopg2` will match that of `psycopg2-binary`. - - -## Contribute - -See `CONTRIBUTING.md` for a detailed overview of contributing a code change to this adapter. - -## Join the dbt Community - -- Be part of the conversation in the [dbt Community Slack](http://community.getdbt.com/) -- Read more on the [dbt Community Discourse](https://discourse.getdbt.com) - -## Reporting bugs and contributing code - -- Want to report a bug or request a feature? Let us know on [Slack](http://community.getdbt.com/), or open [an issue](https://github.com/dbt-labs/dbt-postgres/issues/new) -- Want to help us build dbt? Check out the [Contributing Guide](https://github.com/dbt-labs/dbt-postgres/blob/main/CONTRIBUTING.md) - -## Code of Conduct -Everyone interacting in the dbt project's codebases, issue trackers, chat rooms, and mailing lists is expected to follow the [dbt Code of Conduct](https://community.getdbt.com/code-of-conduct). +This repository has moved into [dbt-labs/dbt-adapters](https://www.github.com/dbt-labs/dbt-adapters). +Please refer to that repo for information about `dbt-postgres`.