Skip to content

Commit f01cb78

Browse files
authored
Fix case for StreamingDataFrame class in docs (#540)
1 parent 03a35ec commit f01cb78

File tree

4 files changed

+27
-27
lines changed

4 files changed

+27
-27
lines changed

docs/api-reference/dataframe.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ usage, see `streamingdataframe.md` under the `docs/` folder.
5656
***Example Snippet:***
5757

5858
```python
59-
sdf = StreamingDataframe()
59+
sdf = StreamingDataFrame()
6060
sdf = sdf.apply(a_func)
6161
sdf = sdf.filter(another_func)
6262
sdf = sdf.to_topic(topic_obj)
@@ -101,7 +101,7 @@ def func(d: dict, state: State):
101101
state.set("my_store_key") = value
102102
return {k: v.upper() if isinstance(v, str) else v for k, v in d.items()}
103103

104-
sdf = StreamingDataframe()
104+
sdf = StreamingDataFrame()
105105
sdf = sdf.apply(func, stateful=True)
106106
sdf = sdf.apply(lambda d: {k: v for k,v in d.items() if isinstance(v, str)})
107107

@@ -166,7 +166,7 @@ def func(values: list, state: State):
166166
state.set("my_store_key") = value
167167
values.append("new_item")
168168

169-
sdf = StreamingDataframe()
169+
sdf = StreamingDataFrame()
170170
sdf = sdf.update(func, stateful=True)
171171
# does not require reassigning
172172
sdf.update(lambda v: v.append(1))
@@ -229,7 +229,7 @@ def func(d: dict, state: State):
229229
return True
230230
return False
231231

232-
sdf = StreamingDataframe()
232+
sdf = StreamingDataFrame()
233233
sdf = sdf.filter(func, stateful=True)
234234
```
235235

@@ -289,7 +289,7 @@ def func(d: dict, state: State):
289289
d["customer_total"] = new_total
290290
return d
291291

292-
sdf = StreamingDataframe()
292+
sdf = StreamingDataFrame()
293293
sdf = sdf.group_by("customer_account_id")
294294
sdf = sdf.apply(func, stateful=True)
295295
```
@@ -335,7 +335,7 @@ Check if the key is present in the Row value.
335335
# Add new column 'has_column' which contains a boolean indicating
336336
# the presence of 'column_x'
337337

338-
sdf = StreamingDataframe()
338+
sdf = StreamingDataFrame()
339339
sdf['has_column'] = sdf.contains('column_x')
340340
```
341341

@@ -859,7 +859,7 @@ original `StreamingDataFrame` is returned for chaining (`sdf.update().print()`).
859859
# Remove columns "x" and "y" from the value.
860860
# This would transform {"x": 1, "y": 2, "z": 3} to {"z": 3}
861861

862-
sdf = StreamingDataframe()
862+
sdf = StreamingDataFrame()
863863
sdf.drop(["x", "y"])
864864
```
865865

@@ -965,7 +965,7 @@ with `StreamingSeries`, and you shouldn't have to think about them explicitly.
965965
# Random methods for example purposes. More detailed explanations found under
966966
# various methods or in the docs folder.
967967

968-
sdf = StreamingDataframe()
968+
sdf = StreamingDataFrame()
969969
sdf = sdf["column_a"].apply(a_func).apply(diff_func, stateful=True)
970970
sdf["my_new_bool_field"] = sdf["column_b"].contains("this_string")
971971
sdf["new_sum_field"] = sdf["column_c"] + sdf["column_d"] + 2
@@ -1038,7 +1038,7 @@ def func(value: str, state: State):
10381038
state.set("my_store_key") = value
10391039
return v.upper()
10401040

1041-
sdf = StreamingDataframe()
1041+
sdf = StreamingDataFrame()
10421042
sdf["new_col"] = sdf["a_column"]["nested_dict_key"].apply(func, stateful=True)
10431043
sdf["new_col_2"] = sdf["str_col"].apply(lambda v: int(v)) + sdf["str_col2"] + 2
10441044
```

docs/api-reference/quixstreams.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ usage, see `streamingdataframe.md` under the `docs/` folder.
764764
Example Snippet:
765765

766766
```python
767-
sdf = StreamingDataframe()
767+
sdf = StreamingDataFrame()
768768
sdf = sdf.apply(a_func)
769769
sdf = sdf.filter(another_func)
770770
sdf = sdf.to_topic(topic_obj)
@@ -805,7 +805,7 @@ def func(d: dict, state: State):
805805
state.set("my_store_key") = value
806806
return {k: v.upper() if isinstance(v, str) else v for k, v in d.items()}
807807

808-
sdf = StreamingDataframe()
808+
sdf = StreamingDataFrame()
809809
sdf = sdf.apply(func, stateful=True)
810810
sdf = sdf.apply(lambda d: {k: v for k,v in d.items() if isinstance(v, str)})
811811

@@ -864,7 +864,7 @@ def func(values: list, state: State):
864864
state.set("my_store_key") = value
865865
values.append("new_item")
866866

867-
sdf = StreamingDataframe()
867+
sdf = StreamingDataFrame()
868868
sdf = sdf.update(func, stateful=True)
869869
# does not require reassigning
870870
sdf.update(lambda v: v.append(1))
@@ -919,7 +919,7 @@ def func(d: dict, state: State):
919919
return True
920920
return False
921921

922-
sdf = StreamingDataframe()
922+
sdf = StreamingDataFrame()
923923
sdf = sdf.filter(func, stateful=True)
924924
```
925925

@@ -973,7 +973,7 @@ def func(d: dict, state: State):
973973
d["customer_total"] = new_total
974974
return d
975975

976-
sdf = StreamingDataframe()
976+
sdf = StreamingDataFrame()
977977
sdf = sdf.group_by("customer_account_id")
978978
sdf = sdf.apply(func, stateful=True)
979979
```
@@ -1011,7 +1011,7 @@ Example Snippet:
10111011
# Add new column 'has_column' which contains a boolean indicating
10121012
# the presence of 'column_x'
10131013

1014-
sdf = StreamingDataframe()
1014+
sdf = StreamingDataFrame()
10151015
sdf['has_column'] = sdf.contains('column_x')
10161016
```
10171017

@@ -1463,7 +1463,7 @@ Example Snippet:
14631463
# Remove columns "x" and "y" from the value.
14641464
# This would transform {"x": 1, "y": 2, "z": 3} to {"z": 3}
14651465

1466-
sdf = StreamingDataframe()
1466+
sdf = StreamingDataFrame()
14671467
sdf.drop(["x", "y"])
14681468
```
14691469

@@ -1557,7 +1557,7 @@ Example Snippet:
15571557
# Random methods for example purposes. More detailed explanations found under
15581558
# various methods or in the docs folder.
15591559

1560-
sdf = StreamingDataframe()
1560+
sdf = StreamingDataFrame()
15611561
sdf = sdf["column_a"].apply(a_func).apply(diff_func, stateful=True)
15621562
sdf["my_new_bool_field"] = sdf["column_b"].contains("this_string")
15631563
sdf["new_sum_field"] = sdf["column_c"] + sdf["column_d"] + 2
@@ -1620,7 +1620,7 @@ def func(value: str, state: State):
16201620
state.set("my_store_key") = value
16211621
return v.upper()
16221622

1623-
sdf = StreamingDataframe()
1623+
sdf = StreamingDataFrame()
16241624
sdf["new_col"] = sdf["a_column"]["nested_dict_key"].apply(func, stateful=True)
16251625
sdf["new_col_2"] = sdf["str_col"].apply(lambda v: int(v)) + sdf["str_col2"] + 2
16261626
```

quixstreams/dataframe/dataframe.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class StreamingDataFrame(BaseStreaming):
101101
Example Snippet:
102102
103103
```python
104-
sdf = StreamingDataframe()
104+
sdf = StreamingDataFrame()
105105
sdf = sdf.apply(a_func)
106106
sdf = sdf.filter(another_func)
107107
sdf = sdf.to_topic(topic_obj)
@@ -197,7 +197,7 @@ def func(d: dict, state: State):
197197
state.set("my_store_key") = value
198198
return {k: v.upper() if isinstance(v, str) else v for k, v in d.items()}
199199
200-
sdf = StreamingDataframe()
200+
sdf = StreamingDataFrame()
201201
sdf = sdf.apply(func, stateful=True)
202202
sdf = sdf.apply(lambda d: {k: v for k,v in d.items() if isinstance(v, str)})
203203
@@ -291,7 +291,7 @@ def func(values: list, state: State):
291291
state.set("my_store_key") = value
292292
values.append("new_item")
293293
294-
sdf = StreamingDataframe()
294+
sdf = StreamingDataFrame()
295295
sdf = sdf.update(func, stateful=True)
296296
# does not require reassigning
297297
sdf.update(lambda v: v.append(1))
@@ -379,7 +379,7 @@ def func(d: dict, state: State):
379379
return True
380380
return False
381381
382-
sdf = StreamingDataframe()
382+
sdf = StreamingDataFrame()
383383
sdf = sdf.filter(func, stateful=True)
384384
```
385385
@@ -469,7 +469,7 @@ def func(d: dict, state: State):
469469
d["customer_total"] = new_total
470470
return d
471471
472-
sdf = StreamingDataframe()
472+
sdf = StreamingDataFrame()
473473
sdf = sdf.group_by("customer_account_id")
474474
sdf = sdf.apply(func, stateful=True)
475475
```
@@ -518,7 +518,7 @@ def contains(self, key: str) -> StreamingSeries:
518518
# Add new column 'has_column' which contains a boolean indicating
519519
# the presence of 'column_x'
520520
521-
sdf = StreamingDataframe()
521+
sdf = StreamingDataFrame()
522522
sdf['has_column'] = sdf.contains('column_x')
523523
```
524524
@@ -968,7 +968,7 @@ def drop(
968968
# Remove columns "x" and "y" from the value.
969969
# This would transform {"x": 1, "y": 2, "z": 3} to {"z": 3}
970970
971-
sdf = StreamingDataframe()
971+
sdf = StreamingDataFrame()
972972
sdf.drop(["x", "y"])
973973
```
974974

quixstreams/dataframe/series.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class StreamingSeries(BaseStreaming):
108108
# Random methods for example purposes. More detailed explanations found under
109109
# various methods or in the docs folder.
110110
111-
sdf = StreamingDataframe()
111+
sdf = StreamingDataFrame()
112112
sdf = sdf["column_a"].apply(a_func).apply(diff_func, stateful=True)
113113
sdf["my_new_bool_field"] = sdf["column_b"].contains("this_string")
114114
sdf["new_sum_field"] = sdf["column_c"] + sdf["column_d"] + 2
@@ -174,7 +174,7 @@ def func(value: str, state: State):
174174
state.set("my_store_key") = value
175175
return v.upper()
176176
177-
sdf = StreamingDataframe()
177+
sdf = StreamingDataFrame()
178178
sdf["new_col"] = sdf["a_column"]["nested_dict_key"].apply(func, stateful=True)
179179
sdf["new_col_2"] = sdf["str_col"].apply(lambda v: int(v)) + sdf["str_col2"] + 2
180180
```

0 commit comments

Comments
 (0)