-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Add explanation and recommendations for context usage (#1060)
- Loading branch information
1 parent
b9f693b
commit c859845
Showing
3 changed files
with
33 additions
and
11 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,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. |
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 |
---|---|---|
|
@@ -63,6 +63,7 @@ Advanced Topics | |
|
||
parent_streams | ||
partitioning | ||
context_object | ||
stream_maps | ||
batch | ||
porting | ||
|
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