Skip to content

Commit d95b11f

Browse files
authored
chore: other updates for sdf beta1 (#149)
Co-authored-by: Luis Moreno <morenol@users.noreply.github.com>
1 parent 8a31779 commit d95b11f

File tree

3 files changed

+8
-20
lines changed

3 files changed

+8
-20
lines changed

sdf/cli/run.mdx

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,10 @@ Arguments:
8787
Options:
8888
--key <KEY> key of state
8989
--filter <FILTER> filter regex
90-
--table
9190
```
9291

9392
Where:
9493
* `--key` and `--filter` refines the result.
95-
* `--table` formats the output.
9694

9795
#### Examples
9896

@@ -126,16 +124,6 @@ Show the detailed information:
126124

127125
```bash copy="fl"
128126
>> show state filter-service/filter-questions/metrics
129-
Key Window Value
130-
stats * {succeeded:2,failed:0,}
131-
```
132-
133-
#### Format the result
134-
135-
Some states can be displayed in table format:
136-
137-
```bash copy="fl"
138-
>> show state filter-service/filter-questions/metrics --table
139127
Key Window succeeded failed
140128
stats * 2 0
141129
```

sdf/dataflow-inline.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ $ cd split-sentence-inline
3030
Create the `dataflow.yaml` and add the following content:
3131

3232
```yaml title="dataflow.yaml"
33-
apiVersion: 0.4.0
33+
apiVersion: 0.5.0
3434

3535
meta:
3636
name: split-sentence-inline
@@ -61,12 +61,12 @@ services:
6161
transforms:
6262
- operator: flat-map
6363
run: |
64-
fn sentence_to_words(sentence: String) -> Result<Vec<String>, String> {
64+
fn sentence_to_words(sentence: String) -> Result<Vec<String>> {
6565
Ok(sentence.split_whitespace().map(String::from).collect())
6666
}
6767
- operator: map
6868
run: |
69-
pub fn augment_count(word: String) -> Result<String, String> {
69+
pub fn augment_count(word: String) -> Result<String> {
7070
Ok(format!("{}({})", word, word.chars().count()))
7171
}
7272
@@ -119,15 +119,15 @@ The dataflow collects runtime metrics that you can inspect in the runtime termin
119119
Check the `sentence-to-words` counters:
120120

121121
```bash copy="fl"
122-
>> show state sentence-words/sentence-to-words/metrics --table
122+
>> show state sentence-words/sentence-to-words/metrics
123123
Key Window succeeded failed
124124
stats * 2 0
125125
```
126126

127127
Check the `augment-count` counters:
128128

129129
```bash copy="fl"
130-
>> show state sentence-words/augment-count/metrics --table
130+
>> show state sentence-words/augment-count/metrics
131131
Key Window succeeded failed
132132
stats * 4 0
133133
```

sdf/services/split.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Add the following `dataflow.yaml` file:
3838

3939
```yaml
4040
# dataflow.yaml
41-
apiVersion: 0.4.0
41+
apiVersion: 0.5.0
4242
4343
meta:
4444
name: split
@@ -81,15 +81,15 @@ services:
8181
transforms:
8282
- operator: filter
8383
run: |
84-
fn is_child(person: Person) -> Result<bool, String> {
84+
fn is_child(person: Person) -> Result<bool> {
8585
Ok(person.age < 18)
8686
}
8787
- type: topic
8888
id: adult
8989
transforms:
9090
- operator: filter
9191
run: |
92-
fn is_adult(person: Person) -> Result<bool, String> {
92+
fn is_adult(person: Person) -> Result<bool> {
9393
Ok(person.age >= 18)
9494
}
9595
```

0 commit comments

Comments
 (0)