Skip to content

Commit

Permalink
Merge branch 'main' into kgpayne/issue1021
Browse files Browse the repository at this point in the history
  • Loading branch information
Ken Payne authored Oct 20, 2022
2 parents 0d7c431 + 2721dc5 commit 3f9aa9e
Show file tree
Hide file tree
Showing 16 changed files with 213 additions and 125 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ body:
attributes:
label: Singer SDK Version
description: Version of the library you are using
placeholder: "0.11.1"
placeholder: "0.12.0"
validations:
required: true
- type: dropdown
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/constraints.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pip==22.2.2
pip==22.3
poetry==1.2.2
virtualenv==20.16.5
nox==2022.8.7
Expand Down
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ ci:
autofix_prs: false
autoupdate_schedule: weekly
autoupdate_commit_msg: 'chore: pre-commit autoupdate'
skip: [poetry-lock]

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand Down Expand Up @@ -65,3 +66,10 @@ repos:
singer_sdk/helpers/_simpleeval.py|
tests/core/test_simpleeval.py
)$
- repo: https://github.com/python-poetry/poetry
rev: 1.2.2
hooks:
- id: poetry-check
- id: poetry-lock
args: [--no-update]
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0



## v0.12.0 (2022-10-17)

### ✨ New

- [#1032](https://github.com/meltano/sdk/issues/1032) Support stream property selection push-down in SQL streams
- [#978](https://github.com/meltano/sdk/issues/978) Allow configuring a dedicated metrics logger

### 🐛 Fixes

- [#1043](https://github.com/meltano/sdk/issues/1043) Batch storage `split_url` to work with Windows paths -- _**Thanks @BuzzCutNorman!**_
- [#826](https://github.com/meltano/sdk/issues/826) Remove Poetry version pin for GitHub Actions -- _**Thanks @visch!**_
- [#1001](https://github.com/meltano/sdk/issues/1001) Use column name in `allow_column_alter` error message

### 📚 Documentation Improvements

- [#1060](https://github.com/meltano/sdk/issues/1060) Add explanation and recommendations for context usage
- [#1074](https://github.com/meltano/sdk/issues/1074) Document an example implementation and usage of `BaseHATEOASPaginator`
- [#1020](https://github.com/meltano/sdk/issues/1020) Fixed typo in `docs/stream_maps.md` -- _**Thanks @spacecowboy!**_
- [#1006](https://github.com/meltano/sdk/issues/1006) Add links to Meltano install/tut

## v0.11.1 (2022-09-27)

### 🐛 Fixes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ license = "Apache 2.0"
[tool.poetry.dependencies]
python = "<3.11,>=3.7.1"
requests = "^2.25.1"
singer-sdk = "^0.11.1"
singer-sdk = "^0.12.0"

[tool.poetry.dev-dependencies]
pytest = "^6.2.5"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ license = "Apache 2.0"
[tool.poetry.dependencies]
python = "<3.11,>=3.7.1"
requests = "^2.25.1"
singer-sdk = "^0.11.1"
singer-sdk = "^0.12.0"

[tool.poetry.dev-dependencies]
pytest = "^6.2.5"
Expand Down
5 changes: 0 additions & 5 deletions docs/_static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ a:hover {
top: 1px;
}

.wy-side-nav-search > a::after {
display: inline-block;
content: "| SDK";
}

.wy-side-nav-search > div.version {
color: hsla(0, 0%, 100%, 0.7);
}
Expand Down
7 changes: 6 additions & 1 deletion docs/_static/img/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
author = "Meltano Core Team and Contributors"

# The full version, including alpha/beta/rc tags
release = "0.11.1"
release = "0.12.0"


# -- General configuration ---------------------------------------------------
Expand Down
18 changes: 18 additions & 0 deletions docs/context_object.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# The Context Object

Many of the methods in the [Stream](classes/singer_sdk.Stream) class and its subclasses accept
a `context` parameter, which is a dictionary that contains information about the stream
partition or parent stream.

## Best practices for using context

- The context object MUST NOT contain any sensitive information, such as API keys or secrets.
This is because the context is<br><br>

1) sent to the target,
2) stored in the state file and
3) logged to the console as a tag in metrics and logs.<br><br>

- The context object SHOULD NOT be mutated during the stream's lifecycle. This is because the
context is stored in the state file, and mutating it will cause the state file to be
inconsistent with the actual state of the stream.
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Advanced Topics

parent_streams
partitioning
context_object
stream_maps
batch
porting
Expand Down
25 changes: 14 additions & 11 deletions docs/partitioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,23 @@ which each have their own state and their own distinct queryable domain.

## If you do not require partitioning

In general, developers can simply ignore the `context` arguments in methods like
`Stream.get_records()` if partitioning is not required.
In general, developers can simply ignore the [`context`](./context_object.md) arguments
in methods like [`Stream.get_records()`](singer_sdk.Stream.get_records) if partitioning
is not required.

## If you do want to utilize partitioning

To take advantage of partitioning, first override the `Stream.partitions` property,
returning a list of dictionaries, where each dictionary uniquely defines the construct of
a partition. For instance, a regionally partitioned stream may return the following:
To take advantage of partitioning, first override the
[`Stream.partitions`](singer_sdk.Stream.partitions) property, returning a list of
dictionaries, where each dictionary uniquely defines the construct of a partition.
For instance, a regionally partitioned stream may return the following:

`[{"region": "us-east"}, {"region": "us-west"}, ...]`

For any streams which define the `partitions` property, the individual partitions will be
passed one at a time through the `partition` argument of methods which reference the
partition, such as `Stream.get_records()`.
For any streams which define the [`partitions`](singer_sdk.Stream.partitions) property,
the individual partitions will be passed one at a time through the `context` argument
of methods which reference the partition, such as
[`Stream.get_records()`](singer_sdk.Stream.get_records).

## If you are unsure if partitioning will be needed

Expand All @@ -28,9 +31,9 @@ work regardless of whether partition is an actual partition context or `None`, m
no partition is specified.

When dealing with state, for example, developers may always call
`Stream.get_context_state(context)` even if `context` is not set.
The method will automatically return the state that is appropriate, either for the partition
or for the stream.
[`Stream.get_context_state(context)`](singer_sdk.Stream.get_context_state) even if
`context` is not set. The method will automatically return the state that is appropriate,
either for the partition or for the stream.

## Additional State Partitioning References

Expand Down
Loading

0 comments on commit 3f9aa9e

Please sign in to comment.