From cbb858a1d4545cf57e2e2750aebed8bdb20fdc99 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 5 Jun 2023 10:46:26 +0000 Subject: [PATCH 1/4] chore: Release v0.28.0 (#1746) Co-authored-by: kgpayne --- .github/ISSUE_TEMPLATE/bug.yml | 2 +- CHANGELOG.md | 23 +++++++++++++++++++ .../{{cookiecutter.tap_id}}/pyproject.toml | 4 ++-- .../{{cookiecutter.target_id}}/pyproject.toml | 4 ++-- docs/conf.py | 2 +- pyproject.toml | 4 ++-- 6 files changed, 31 insertions(+), 8 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index 757feff41b..d43ec56a31 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -15,7 +15,7 @@ body: attributes: label: Singer SDK Version description: Version of the library you are using - placeholder: "0.27.0" + placeholder: "0.28.0" validations: required: true - type: checkboxes diff --git a/CHANGELOG.md b/CHANGELOG.md index cdddfea222..976a1bef94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,29 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## v0.28.0 (2023-06-05) + +### ✨ New + +- [#1728](https://github.com/meltano/sdk/issues/1728) Add an optional Dependabot file to projects generated from templates +- [#1572](https://github.com/meltano/sdk/issues/1572) Add `batch_config` handling in `append_builtin_config()` -- _**Thanks @aaronsteers!**_ +- [#1686](https://github.com/meltano/sdk/issues/1686) Log stream errors +- [#1711](https://github.com/meltano/sdk/issues/1711) Validate records against stream schema in standard tap tests +- [#1709](https://github.com/meltano/sdk/issues/1709) Add a default Apache 2.0 license to tap and target templates + +### 🐛 Fixes + +- [#1742](https://github.com/meltano/sdk/issues/1742) Recommend `meltano run` in target cookiecutter README + +### ⚙️ Under the Hood + +- [#936](https://github.com/meltano/sdk/issues/936) Use inheritance to construct plugin CLI + +### 📚 Documentation Improvements + +- [#1721](https://github.com/meltano/sdk/issues/1721) Remove unsupported `previous_token` from HATEOAS example +- [#1703](https://github.com/meltano/sdk/issues/1703) Fix broken docs link for `record_metadata` page -- _**Thanks @menzenski!**_ + ## v0.27.0 (2023-05-11) ### ✨ New diff --git a/cookiecutter/tap-template/{{cookiecutter.tap_id}}/pyproject.toml b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/pyproject.toml index db29453481..0fd2b65815 100644 --- a/cookiecutter/tap-template/{{cookiecutter.tap_id}}/pyproject.toml +++ b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/pyproject.toml @@ -21,7 +21,7 @@ packages = [ [tool.poetry.dependencies] python = "<3.12,>=3.7.1" -singer-sdk = { version="^0.27.0" } +singer-sdk = { version="^0.28.0" } fs-s3fs = { version = "^1.1.1", optional = true } {%- if cookiecutter.stream_type in ["REST", "GraphQL"] %} requests = "^2.31.0" @@ -32,7 +32,7 @@ cached-property = "^1" # Remove after Python 3.7 support is dropped [tool.poetry.group.dev.dependencies] pytest = "^7.2.1" -singer-sdk = { version="^0.27.0", extras = ["testing"] } +singer-sdk = { version="^0.28.0", extras = ["testing"] } [tool.poetry.extras] s3 = ["fs-s3fs"] diff --git a/cookiecutter/target-template/{{cookiecutter.target_id}}/pyproject.toml b/cookiecutter/target-template/{{cookiecutter.target_id}}/pyproject.toml index 057c81deb0..8d56d981cb 100644 --- a/cookiecutter/target-template/{{cookiecutter.target_id}}/pyproject.toml +++ b/cookiecutter/target-template/{{cookiecutter.target_id}}/pyproject.toml @@ -21,7 +21,7 @@ packages = [ [tool.poetry.dependencies] python = "<3.12,>=3.7.1" -singer-sdk = { version="^0.27.0" } +singer-sdk = { version="^0.28.0" } fs-s3fs = { version = "^1.1.1", optional = true } {%- if cookiecutter.serialization_method != "SQL" %} requests = "^2.31.0" @@ -29,7 +29,7 @@ requests = "^2.31.0" [tool.poetry.dev-dependencies] pytest = "^7.2.1" -singer-sdk = { version="^0.27.0", extras = ["testing"] } +singer-sdk = { version="^0.28.0", extras = ["testing"] } [tool.poetry.extras] s3 = ["fs-s3fs"] diff --git a/docs/conf.py b/docs/conf.py index 9fbbade6c3..87df1b6b70 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -26,7 +26,7 @@ author = "Meltano Core Team and Contributors" # The full version, including alpha/beta/rc tags -release = "0.27.0" +release = "0.28.0" # -- General configuration --------------------------------------------------- diff --git a/pyproject.toml b/pyproject.toml index 0f0c106aeb..3c0384d3cb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "singer-sdk" -version = "0.27.0" +version = "0.28.0" description = "A framework for building Singer taps" authors = ["Meltano Team and Contributors"] maintainers = ["Meltano Team and Contributors"] @@ -142,7 +142,7 @@ norecursedirs = "cookiecutter" [tool.commitizen] name = "cz_version_bump" -version = "0.27.0" +version = "0.28.0" tag_format = "v$major.$minor.$patch$prerelease" version_files = [ "docs/conf.py", From fda24cfba259b917d0ab3a74b355346e7b0027e9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Jun 2023 14:57:31 +0000 Subject: [PATCH 2/4] chore(deps): Bump actions/dependency-review-action from 3.0.4 to 3.0.6 (#1747) --- .github/workflows/dependency-review.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index 00490561b1..dc7c94bbd7 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -20,7 +20,7 @@ jobs: - name: GitHub dependency vulnerability check if: ${{ github.event_name == 'pull_request_target' }} - uses: actions/dependency-review-action@v3.0.4 + uses: actions/dependency-review-action@v3.0.6 with: fail-on-severity: high From 07a63c2c17b146b52b7244d2d707d2df9012598d Mon Sep 17 00:00:00 2001 From: mjsqu Date: Tue, 6 Jun 2023 11:34:22 +1200 Subject: [PATCH 3/4] refactor(taps): Change `SQLStream.schema` into a cached property (#1745) * Change schema into a cached_property Schema is called at least once per record and does not change within a stream, so it should be cached for performance benefits. * Fix missing sys import * Changes for 3.7 compatibility ``` @property @lru_cache() ``` is a backwards compatible version of functools.cached_property for Python 3.7 https://stackoverflow.com/questions/4037481/caching-class-attributes-in-python * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add parentheses to lru_cache for py 3.7 * Fix schema return type mypy checks fail because the schema return type is lru_cache: ``` singer_sdk/streams/sql.py:82: error: Signature of "schema" incompatible with supertype "Stream" [override] singer_sdk/streams/sql.py:154: error: Argument "schema" to "get_selected_schema" has incompatible type "_lru_cache_wrapper[Dict[Any, Any]]"; expected "Dict[Any, Any]" [arg-type] Found 2 errors in 1 file (checked 59 source files) ``` The update should pass over the `_lru_cache_wrapper` type and return a `Dict` as expected * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix for mypy - Remove `lru_cache` - Set `_cached_schema` up as a class variable to hold the schema for each stream - Check for presence of `self._cached_schema` on the stream * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Re-add removed TYPE_CHECKING * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Edgar R. M --- singer_sdk/streams/sql.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/singer_sdk/streams/sql.py b/singer_sdk/streams/sql.py index 3d3de5bbec..7a3fe3886b 100644 --- a/singer_sdk/streams/sql.py +++ b/singer_sdk/streams/sql.py @@ -20,6 +20,7 @@ class SQLStream(Stream, metaclass=abc.ABCMeta): """Base class for SQLAlchemy-based streams.""" connector_class = SQLConnector + _cached_schema: dict | None = None def __init__( self, @@ -74,7 +75,7 @@ def metadata(self) -> MetadataMapping: """ return self._singer_catalog_entry.metadata - @property + @property # TODO: Investigate @cached_property after py > 3.7 def schema(self) -> dict: """Return metadata object (dict) as specified in the Singer spec. @@ -83,7 +84,13 @@ def schema(self) -> dict: Returns: The schema object. """ - return t.cast(dict, self._singer_catalog_entry.schema.to_dict()) + if not self._cached_schema: + self._cached_schema = t.cast( + dict, + self._singer_catalog_entry.schema.to_dict(), + ) + + return self._cached_schema @property def tap_stream_id(self) -> str: From 5267160fda096e07ba6ec86725fd98aa9cee9ae9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Jun 2023 22:16:23 -0600 Subject: [PATCH 4/4] chore: pre-commit autoupdate (#1751) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/python-jsonschema/check-jsonschema: 0.23.0 → 0.23.1](https://github.com/python-jsonschema/check-jsonschema/compare/0.23.0...0.23.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8d308ac62a..3b4bcc3152 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,7 @@ repos: )$ - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.23.0 + rev: 0.23.1 hooks: - id: check-dependabot - id: check-github-workflows