Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Document support for comprehenions in stream maps #2017

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions docs/stream_maps.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,32 @@ Expressions are defined and parsed using the
accepts most native python expressions and is extended by custom functions which have been declared
within the SDK.

#### Compound Expressions

Starting in version 0.33.0, the SDK supports the use of simple comprehensions, e.g. `[x + 1 for x in [1,2,3]]`. This is a powerful feature which allows you to perform complex transformations on lists of values. For example, you can use comprehensions to filter out values in an array:

````{tab} meltano.yml
```yaml
stream_maps:
users:
id: id
fields: "[f for f in fields if f['key'] != 'age']"
```
````

````{tab} JSON
```json
{
"stream_maps": {
"users": {
"id": "id",
"fields": "[f for f in fields if f['key'] != 'age']"
}
}
}
```
````

### Accessing Stream Properties within Mapping Expressions

By default, all stream properties are made available via the property's given name. For
Expand Down