From 44e954b7d5fa32df51f917f71ce62c6e6099cb32 Mon Sep 17 00:00:00 2001 From: Alexander Streed Date: Tue, 6 Dec 2022 17:57:24 -0600 Subject: [PATCH] Performs cruft update (#99) * Performs cruft update * Fix static analyses Co-authored-by: ahuang11 --- .cruft.json | 2 +- .github/PULL_REQUEST_TEMPLATE.md | 42 +++++++++++++++----------------- .pre-commit-config.yaml | 8 ++++++ MAINTAINERS.md | 8 ++---- prefect_dbt/cloud/utils.py | 2 -- tests/conftest.py | 14 +++++++++++ 6 files changed, 44 insertions(+), 32 deletions(-) diff --git a/.cruft.json b/.cruft.json index 5a2c473..b30c18c 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "https://github.com/PrefectHQ/prefect-collection-template", - "commit": "e3d7ae506a6c84fdb78d2e74177833d625d72198", + "commit": "dabff0c99e3eb545d926ec6026bf8843e84eeb6a", "checkout": null, "context": { "cookiecutter": { diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 523177b..30c2c4c 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,32 +1,28 @@ - -We've got a few requests to help us review contributions: + -- Make sure that your title neatly summarizes the proposed changes. -- Provide a short overview of the change and the value it adds. -- Share an example to help us understand the change in user experience. -- Run `pre-commit install && pre-commit run --all` for linting. - -Happy engineering! ---> - - - - -Closes # +Closes ### Example - + +### Screenshots + ### Checklist -- [ ] This pull request references any related issue by including "Closes #" - - If no issue exists and your change is not a small fix, please [create an issue](https://github.com/PrefectHQ/prefect-dbt/issues/new/choose) first. -- [ ] This pull request includes tests or only affects documentation. -- [ ] Summarized PR's changes in [CHANGELOG.md](https://github.com/PrefectHQ/prefect-dbt/blob/main/CHANGELOG.md) +- [ ] References any related issue by including "Closes #" or "Closes ". + - If no issue exists and your change is not a small fix, please [create an issue](https://github.com/PrefectHQ/prefect-dbt/issues/new/choose) first. +- [ ] Includes tests or only affects documentation. +- [ ] Passes `pre-commit` checks. + - Run `pre-commit install && pre-commit run --all` locally for formatting and linting. +- [ ] Includes screenshots of documentation updates. + - Run `mkdocs serve` view documentation locally. +- [ ] Summarizes PR's changes in [CHANGELOG.md](https://github.com/PrefectHQ/prefect-dbt/blob/main/CHANGELOG.md) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 47b4b4b..80f9b44 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,3 +19,11 @@ repos: - id: interrogate args: [-vv] pass_filenames: false + - repo: https://github.com/fsouza/autoflake8 + rev: v0.3.2 + hooks: + - id: autoflake8 + language_version: python3 + args: [ + '--in-place', + ] diff --git a/MAINTAINERS.md b/MAINTAINERS.md index 7bbdd9a..e7ceb8d 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -2,6 +2,8 @@ ## Getting Started +Now that you've bootstrapped a project, follow the steps below to get started developing your Prefect Collection! + ### Python setup Requires an installation of Python 3.7+ @@ -10,12 +12,6 @@ We recommend using a Python virtual environment manager such as pipenv, conda or ### GitHub setup -Generate a Prefect Collection project in the terminal: - -```bash -cookiecutter https://github.com/PrefectHQ/prefect-collection-template -``` - Create a Git respoitory for the newly generated collection and create the first commit: ```bash diff --git a/prefect_dbt/cloud/utils.py b/prefect_dbt/cloud/utils.py index 0180d35..5e29c0f 100644 --- a/prefect_dbt/cloud/utils.py +++ b/prefect_dbt/cloud/utils.py @@ -44,8 +44,6 @@ def extract_developer_message(ex: HTTPStatusError) -> Optional[str]: class DbtCloudAdministrativeApiCallFailed(Exception): """Raised when a call to dbt Cloud administrative API fails.""" - pass - @task( name="Call dbt Cloud administrative API endpoint", diff --git a/tests/conftest.py b/tests/conftest.py index 45c4c6d..32ab4ee 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -13,10 +13,24 @@ def dbt_cloud_credentials(): @pytest.fixture(scope="session", autouse=True) def prefect_db(): + """ + Sets up test harness for temporary DB during test runs. + """ with prefect_test_harness(): yield +@pytest.fixture(autouse=True) +def reset_object_registry(): + """ + Ensures each test has a clean object registry. + """ + from prefect.context import PrefectObjectRegistry + + with PrefectObjectRegistry(): + yield + + @pytest.fixture def dbt_cli_profile(): target_configs = TargetConfigs(