streamlit-nightly 1.33.1.dev20240423__py2.py3-none-any.whl → 1.33.1.dev20240424__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. streamlit/elements/heading.py +9 -6
  2. streamlit/elements/layouts.py +13 -9
  3. streamlit/elements/markdown.py +6 -4
  4. streamlit/elements/metric.py +3 -2
  5. streamlit/elements/progress.py +3 -2
  6. streamlit/elements/toast.py +3 -2
  7. streamlit/elements/widgets/button.py +12 -8
  8. streamlit/elements/widgets/camera_input.py +3 -2
  9. streamlit/elements/widgets/checkbox.py +6 -4
  10. streamlit/elements/widgets/color_picker.py +3 -2
  11. streamlit/elements/widgets/file_uploader.py +3 -2
  12. streamlit/elements/widgets/multiselect.py +3 -2
  13. streamlit/elements/widgets/number_input.py +3 -2
  14. streamlit/elements/widgets/radio.py +3 -2
  15. streamlit/elements/widgets/select_slider.py +3 -2
  16. streamlit/elements/widgets/selectbox.py +3 -2
  17. streamlit/elements/widgets/slider.py +3 -2
  18. streamlit/elements/widgets/text_widgets.py +6 -4
  19. streamlit/elements/widgets/time_widgets.py +6 -4
  20. streamlit/elements/write.py +11 -3
  21. streamlit/static/asset-manifest.json +2 -2
  22. streamlit/static/index.html +1 -1
  23. streamlit/static/static/js/main.3d71c26f.js +2 -0
  24. {streamlit_nightly-1.33.1.dev20240423.dist-info → streamlit_nightly-1.33.1.dev20240424.dist-info}/METADATA +1 -1
  25. {streamlit_nightly-1.33.1.dev20240423.dist-info → streamlit_nightly-1.33.1.dev20240424.dist-info}/RECORD +30 -30
  26. streamlit/static/static/js/main.d3201242.js +0 -2
  27. /streamlit/static/static/js/{main.d3201242.js.LICENSE.txt → main.3d71c26f.js.LICENSE.txt} +0 -0
  28. {streamlit_nightly-1.33.1.dev20240423.data → streamlit_nightly-1.33.1.dev20240424.data}/scripts/streamlit.cmd +0 -0
  29. {streamlit_nightly-1.33.1.dev20240423.dist-info → streamlit_nightly-1.33.1.dev20240424.dist-info}/WHEEL +0 -0
  30. {streamlit_nightly-1.33.1.dev20240423.dist-info → streamlit_nightly-1.33.1.dev20240424.dist-info}/entry_points.txt +0 -0
  31. {streamlit_nightly-1.33.1.dev20240423.dist-info → streamlit_nightly-1.33.1.dev20240424.dist-info}/top_level.txt +0 -0
@@ -67,8 +67,9 @@ class HeadingMixin:
67
67
  must be on their own lines). Supported LaTeX functions are listed
68
68
  at https://katex.org/docs/supported.html.
69
69
 
70
- * Colored text, using the syntax ``:color[text to be colored]``,
71
- where ``color`` needs to be replaced with any of the following
70
+ * Colored text and background colors for text, using the syntax
71
+ ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
72
+ respectively — where ``color`` needs to be replaced with any of the following
72
73
  supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
73
74
 
74
75
  anchor : str or False
@@ -137,8 +138,9 @@ class HeadingMixin:
137
138
  must be on their own lines). Supported LaTeX functions are listed
138
139
  at https://katex.org/docs/supported.html.
139
140
 
140
- * Colored text, using the syntax ``:color[text to be colored]``,
141
- where ``color`` needs to be replaced with any of the following
141
+ * Colored text and background colors for text, using the syntax
142
+ ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
143
+ respectively — where ``color`` needs to be replaced with any of the following
142
144
  supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
143
145
 
144
146
  anchor : str or False
@@ -209,8 +211,9 @@ class HeadingMixin:
209
211
  must be on their own lines). Supported LaTeX functions are listed
210
212
  at https://katex.org/docs/supported.html.
211
213
 
212
- * Colored text, using the syntax ``:color[text to be colored]``,
213
- where ``color`` needs to be replaced with any of the following
214
+ * Colored text and background colors for text, using the syntax
215
+ ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
216
+ respectively — where ``color`` needs to be replaced with any of the following
214
217
  supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
215
218
 
216
219
  anchor : str or False
@@ -303,8 +303,9 @@ class LayoutsMixin:
303
303
  must be on their own lines). Supported LaTeX functions are listed
304
304
  at https://katex.org/docs/supported.html.
305
305
 
306
- * Colored text, using the syntax ``:color[text to be colored]``,
307
- where ``color`` needs to be replaced with any of the following
306
+ * Colored text and background colors for text, using the syntax
307
+ ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
308
+ respectively — where ``color`` needs to be replaced with any of the following
308
309
  supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
309
310
 
310
311
  Unsupported elements are unwrapped so only their children (text contents) render.
@@ -413,8 +414,9 @@ class LayoutsMixin:
413
414
  must be on their own lines). Supported LaTeX functions are listed
414
415
  at https://katex.org/docs/supported.html.
415
416
 
416
- * Colored text, using the syntax ``:color[text to be colored]``,
417
- where ``color`` needs to be replaced with any of the following
417
+ * Colored text and background colors for text, using the syntax
418
+ ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
419
+ respectively — where ``color`` needs to be replaced with any of the following
418
420
  supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
419
421
 
420
422
  Unsupported elements are unwrapped so only their children (text contents) render.
@@ -519,9 +521,10 @@ class LayoutsMixin:
519
521
  must be on their own lines). Supported LaTeX functions are listed
520
522
  at https://katex.org/docs/supported.html.
521
523
 
522
- * Colored text, using the syntax ``:color[text to be colored]``,
523
- where ``color`` needs to be replaced with any of the following
524
- supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
524
+ * Colored text and background colors for text, using the syntax
525
+ ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
526
+ respectively where ``color`` needs to be replaced with any of the following
527
+ supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
525
528
 
526
529
  Unsupported elements are unwrapped so only their children (text contents) render.
527
530
  Display unsupported elements as literal characters by
@@ -631,8 +634,9 @@ class LayoutsMixin:
631
634
  must be on their own lines). Supported LaTeX functions are listed
632
635
  at https://katex.org/docs/supported.html.
633
636
 
634
- * Colored text, using the syntax ``:color[text to be colored]``,
635
- where ``color`` needs to be replaced with any of the following
637
+ * Colored text and background colors for text, using the syntax
638
+ ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
639
+ respectively — where ``color`` needs to be replaced with any of the following
636
640
  supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
637
641
 
638
642
  Unsupported elements are unwrapped so only their children (text contents)
@@ -56,8 +56,9 @@ class MarkdownMixin:
56
56
  must be on their own lines). Supported LaTeX functions are listed
57
57
  at https://katex.org/docs/supported.html.
58
58
 
59
- * Colored text, using the syntax ``:color[text to be colored]``,
60
- where ``color`` needs to be replaced with any of the following
59
+ * Colored text and background colors for text, using the syntax
60
+ ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
61
+ respectively — where ``color`` needs to be replaced with any of the following
61
62
  supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
62
63
 
63
64
  unsafe_allow_html : bool
@@ -174,8 +175,9 @@ class MarkdownMixin:
174
175
  must be on their own lines). Supported LaTeX functions are listed
175
176
  at https://katex.org/docs/supported.html.
176
177
 
177
- * Colored text, using the syntax ``:color[text to be colored]``,
178
- where ``color`` needs to be replaced with any of the following
178
+ * Colored text and background colors for text, using the syntax
179
+ ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
180
+ respectively — where ``color`` needs to be replaced with any of the following
179
181
  supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
180
182
 
181
183
  unsafe_allow_html : bool
@@ -79,8 +79,9 @@ class MetricMixin:
79
79
  must be on their own lines). Supported LaTeX functions are listed
80
80
  at https://katex.org/docs/supported.html.
81
81
 
82
- * Colored text, using the syntax ``:color[text to be colored]``,
83
- where ``color`` needs to be replaced with any of the following
82
+ * Colored text and background colors for text, using the syntax
83
+ ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
84
+ respectively — where ``color`` needs to be replaced with any of the following
84
85
  supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
85
86
 
86
87
  Unsupported elements are unwrapped so only their children (text contents) render.
@@ -117,8 +117,9 @@ class ProgressMixin:
117
117
  must be on their own lines). Supported LaTeX functions are listed
118
118
  at https://katex.org/docs/supported.html.
119
119
 
120
- * Colored text, using the syntax ``:color[text to be colored]``,
121
- where ``color`` needs to be replaced with any of the following
120
+ * Colored text and background colors for text, using the syntax
121
+ ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
122
+ respectively — where ``color`` needs to be replaced with any of the following
122
123
  supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
123
124
 
124
125
  Unsupported elements are unwrapped so only their children (text contents) render.
@@ -67,8 +67,9 @@ class ToastMixin:
67
67
  must be on their own lines). Supported LaTeX functions are listed
68
68
  at https://katex.org/docs/supported.html.
69
69
 
70
- * Colored text, using the syntax ``:color[text to be colored]``,
71
- where ``color`` needs to be replaced with any of the following
70
+ * Colored text and background colors for text, using the syntax
71
+ ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
72
+ respectively — where ``color`` needs to be replaced with any of the following
72
73
  supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
73
74
  icon : str or None
74
75
  An optional argument that specifies an emoji to use as
@@ -97,8 +97,9 @@ class ButtonMixin:
97
97
  must be on their own lines). Supported LaTeX functions are listed
98
98
  at https://katex.org/docs/supported.html.
99
99
 
100
- * Colored text, using the syntax ``:color[text to be colored]``,
101
- where ``color`` needs to be replaced with any of the following
100
+ * Colored text and background colors for text, using the syntax
101
+ ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
102
+ respectively — where ``color`` needs to be replaced with any of the following
102
103
  supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
103
104
 
104
105
  Unsupported elements are unwrapped so only their children (text contents) render.
@@ -216,8 +217,9 @@ class ButtonMixin:
216
217
  must be on their own lines). Supported LaTeX functions are listed
217
218
  at https://katex.org/docs/supported.html.
218
219
 
219
- * Colored text, using the syntax ``:color[text to be colored]``,
220
- where ``color`` needs to be replaced with any of the following
220
+ * Colored text and background colors for text, using the syntax
221
+ ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
222
+ respectively — where ``color`` needs to be replaced with any of the following
221
223
  supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
222
224
 
223
225
  Unsupported elements are unwrapped so only their children (text contents)
@@ -376,8 +378,9 @@ class ButtonMixin:
376
378
  must be on their own lines). Supported LaTeX functions are listed
377
379
  at https://katex.org/docs/supported.html.
378
380
 
379
- * Colored text, using the syntax ``:color[text to be colored]``,
380
- where ``color`` needs to be replaced with any of the following
381
+ * Colored text and background colors for text, using the syntax
382
+ ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
383
+ respectively — where ``color`` needs to be replaced with any of the following
381
384
  supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
382
385
 
383
386
  Unsupported elements are unwrapped so only their children (text contents)
@@ -468,8 +471,9 @@ class ButtonMixin:
468
471
  must be on their own lines). Supported LaTeX functions are listed
469
472
  at https://katex.org/docs/supported.html.
470
473
 
471
- * Colored text, using the syntax ``:color[text to be colored]``,
472
- where ``color`` needs to be replaced with any of the following
474
+ * Colored text and background colors for text, using the syntax
475
+ ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
476
+ respectively — where ``color`` needs to be replaced with any of the following
473
477
  supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
474
478
 
475
479
  Unsupported elements are unwrapped so only their children (text contents)
@@ -112,8 +112,9 @@ class CameraInputMixin:
112
112
  must be on their own lines). Supported LaTeX functions are listed
113
113
  at https://katex.org/docs/supported.html.
114
114
 
115
- * Colored text, using the syntax ``:color[text to be colored]``,
116
- where ``color`` needs to be replaced with any of the following
115
+ * Colored text and background colors for text, using the syntax
116
+ ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
117
+ respectively — where ``color`` needs to be replaced with any of the following
117
118
  supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
118
119
 
119
120
  Unsupported elements are unwrapped so only their children (text contents) render.
@@ -86,8 +86,9 @@ class CheckboxMixin:
86
86
  must be on their own lines). Supported LaTeX functions are listed
87
87
  at https://katex.org/docs/supported.html.
88
88
 
89
- * Colored text, using the syntax ``:color[text to be colored]``,
90
- where ``color`` needs to be replaced with any of the following
89
+ * Colored text and background colors for text, using the syntax
90
+ ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
91
+ respectively — where ``color`` needs to be replaced with any of the following
91
92
  supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
92
93
 
93
94
  Unsupported elements are unwrapped so only their children (text contents) render.
@@ -189,8 +190,9 @@ class CheckboxMixin:
189
190
  must be on their own lines). Supported LaTeX functions are listed
190
191
  at https://katex.org/docs/supported.html.
191
192
 
192
- * Colored text, using the syntax ``:color[text to be colored]``,
193
- where ``color`` needs to be replaced with any of the following
193
+ * Colored text and background colors for text, using the syntax
194
+ ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
195
+ respectively — where ``color`` needs to be replaced with any of the following
194
196
  supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
195
197
 
196
198
  Unsupported elements are unwrapped so only their children (text contents) render.
@@ -86,8 +86,9 @@ class ColorPickerMixin:
86
86
  must be on their own lines). Supported LaTeX functions are listed
87
87
  at https://katex.org/docs/supported.html.
88
88
 
89
- * Colored text, using the syntax ``:color[text to be colored]``,
90
- where ``color`` needs to be replaced with any of the following
89
+ * Colored text and background colors for text, using the syntax
90
+ ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
91
+ respectively — where ``color`` needs to be replaced with any of the following
91
92
  supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
92
93
 
93
94
  Unsupported elements are unwrapped so only their children (text contents) render.
@@ -264,8 +264,9 @@ class FileUploaderMixin:
264
264
  must be on their own lines). Supported LaTeX functions are listed
265
265
  at https://katex.org/docs/supported.html.
266
266
 
267
- * Colored text, using the syntax ``:color[text to be colored]``,
268
- where ``color`` needs to be replaced with any of the following
267
+ * Colored text and background colors for text, using the syntax
268
+ ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
269
+ respectively — where ``color`` needs to be replaced with any of the following
269
270
  supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
270
271
 
271
272
  Unsupported elements are unwrapped so only their children (text contents) render.
@@ -179,8 +179,9 @@ class MultiSelectMixin:
179
179
  must be on their own lines). Supported LaTeX functions are listed
180
180
  at https://katex.org/docs/supported.html.
181
181
 
182
- * Colored text, using the syntax ``:color[text to be colored]``,
183
- where ``color`` needs to be replaced with any of the following
182
+ * Colored text and background colors for text, using the syntax
183
+ ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
184
+ respectively — where ``color`` needs to be replaced with any of the following
184
185
  supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
185
186
 
186
187
  Unsupported elements are unwrapped so only their children (text contents) render.
@@ -156,8 +156,9 @@ class NumberInputMixin:
156
156
  must be on their own lines). Supported LaTeX functions are listed
157
157
  at https://katex.org/docs/supported.html.
158
158
 
159
- * Colored text, using the syntax ``:color[text to be colored]``,
160
- where ``color`` needs to be replaced with any of the following
159
+ * Colored text and background colors for text, using the syntax
160
+ ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
161
+ respectively — where ``color`` needs to be replaced with any of the following
161
162
  supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
162
163
 
163
164
  Unsupported elements are unwrapped so only their children (text contents) render.
@@ -119,8 +119,9 @@ class RadioMixin:
119
119
  must be on their own lines). Supported LaTeX functions are listed
120
120
  at https://katex.org/docs/supported.html.
121
121
 
122
- * Colored text, using the syntax ``:color[text to be colored]``,
123
- where ``color`` needs to be replaced with any of the following
122
+ * Colored text and background colors for text, using the syntax
123
+ ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
124
+ respectively — where ``color`` needs to be replaced with any of the following
124
125
  supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
125
126
 
126
127
  Unsupported elements are unwrapped so only their children (text contents) render.
@@ -147,8 +147,9 @@ class SelectSliderMixin:
147
147
  must be on their own lines). Supported LaTeX functions are listed
148
148
  at https://katex.org/docs/supported.html.
149
149
 
150
- * Colored text, using the syntax ``:color[text to be colored]``,
151
- where ``color`` needs to be replaced with any of the following
150
+ * Colored text and background colors for text, using the syntax
151
+ ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
152
+ respectively — where ``color`` needs to be replaced with any of the following
152
153
  supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
153
154
 
154
155
  Unsupported elements are unwrapped so only their children (text contents) render.
@@ -111,8 +111,9 @@ class SelectboxMixin:
111
111
  must be on their own lines). Supported LaTeX functions are listed
112
112
  at https://katex.org/docs/supported.html.
113
113
 
114
- * Colored text, using the syntax ``:color[text to be colored]``,
115
- where ``color`` needs to be replaced with any of the following
114
+ * Colored text and background colors for text, using the syntax
115
+ ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
116
+ respectively — where ``color`` needs to be replaced with any of the following
116
117
  supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
117
118
 
118
119
  Unsupported elements are unwrapped so only their children (text contents) render.
@@ -221,8 +221,9 @@ class SliderMixin:
221
221
  must be on their own lines). Supported LaTeX functions are listed
222
222
  at https://katex.org/docs/supported.html.
223
223
 
224
- * Colored text, using the syntax ``:color[text to be colored]``,
225
- where ``color`` needs to be replaced with any of the following
224
+ * Colored text and background colors for text, using the syntax
225
+ ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
226
+ respectively — where ``color`` needs to be replaced with any of the following
226
227
  supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
227
228
 
228
229
  Unsupported elements are unwrapped so only their children (text contents) render.
@@ -150,8 +150,9 @@ class TextWidgetsMixin:
150
150
  must be on their own lines). Supported LaTeX functions are listed
151
151
  at https://katex.org/docs/supported.html.
152
152
 
153
- * Colored text, using the syntax ``:color[text to be colored]``,
154
- where ``color`` needs to be replaced with any of the following
153
+ * Colored text and background colors for text, using the syntax
154
+ ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
155
+ respectively — where ``color`` needs to be replaced with any of the following
155
156
  supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
156
157
 
157
158
  Unsupported elements are unwrapped so only their children (text contents) render.
@@ -415,8 +416,9 @@ class TextWidgetsMixin:
415
416
  must be on their own lines). Supported LaTeX functions are listed
416
417
  at https://katex.org/docs/supported.html.
417
418
 
418
- * Colored text, using the syntax ``:color[text to be colored]``,
419
- where ``color`` needs to be replaced with any of the following
419
+ * Colored text and background colors for text, using the syntax
420
+ ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
421
+ respectively — where ``color`` needs to be replaced with any of the following
420
422
  supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
421
423
 
422
424
  Unsupported elements are unwrapped so only their children (text contents) render.
@@ -321,8 +321,9 @@ class TimeWidgetsMixin:
321
321
  must be on their own lines). Supported LaTeX functions are listed
322
322
  at https://katex.org/docs/supported.html.
323
323
 
324
- * Colored text, using the syntax ``:color[text to be colored]``,
325
- where ``color`` needs to be replaced with any of the following
324
+ * Colored text and background colors for text, using the syntax
325
+ ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
326
+ respectively — where ``color`` needs to be replaced with any of the following
326
327
  supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
327
328
 
328
329
  Unsupported elements are unwrapped so only their children (text contents) render.
@@ -545,8 +546,9 @@ class TimeWidgetsMixin:
545
546
  must be on their own lines). Supported LaTeX functions are listed
546
547
  at https://katex.org/docs/supported.html.
547
548
 
548
- * Colored text, using the syntax ``:color[text to be colored]``,
549
- where ``color`` needs to be replaced with any of the following
549
+ * Colored text and background colors for text, using the syntax
550
+ ``:color[text to be colored]`` and ``:color-background[text to be colored]``,
551
+ respectively — where ``color`` needs to be replaced with any of the following
550
552
  supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
551
553
 
552
554
  Unsupported elements are unwrapped so only their children (text contents) render.
@@ -197,6 +197,10 @@ class WriteMixin:
197
197
  ) from err
198
198
 
199
199
  if isinstance(chunk, str):
200
+ if not chunk:
201
+ # Empty strings can be ignored
202
+ continue
203
+
200
204
  first_text = False
201
205
  if not stream_container:
202
206
  stream_container = self.dg.empty()
@@ -216,10 +220,14 @@ class WriteMixin:
216
220
 
217
221
  flush_stream_response()
218
222
 
219
- # If the output only contains a single string, return it as a string
220
- if len(written_content) == 1 and isinstance(written_content[0], str):
223
+ if not written_content:
224
+ # If nothing was streamed, return an empty string.
225
+ return ""
226
+ elif len(written_content) == 1 and isinstance(written_content[0], str):
227
+ # If the output only contains a single string, return it as a string
221
228
  return written_content[0]
222
- # Otherwise return it as a list
229
+
230
+ # Otherwise return it as a list of write-compatible objects
223
231
  return written_content
224
232
 
225
233
  @gather_metrics("write")
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "files": {
3
3
  "main.css": "./static/css/main.bf304093.css",
4
- "main.js": "./static/js/main.d3201242.js",
4
+ "main.js": "./static/js/main.3d71c26f.js",
5
5
  "static/js/9336.2d95d840.chunk.js": "./static/js/9336.2d95d840.chunk.js",
6
6
  "static/js/9330.2b4c99e0.chunk.js": "./static/js/9330.2b4c99e0.chunk.js",
7
7
  "static/js/7217.d970c074.chunk.js": "./static/js/7217.d970c074.chunk.js",
@@ -152,6 +152,6 @@
152
152
  },
153
153
  "entrypoints": [
154
154
  "static/css/main.bf304093.css",
155
- "static/js/main.d3201242.js"
155
+ "static/js/main.3d71c26f.js"
156
156
  ]
157
157
  }
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><link rel="shortcut icon" href="./favicon.png"/><link rel="preload" href="./static/media/SourceSansPro-Regular.0d69e5ff5e92ac64a0c9.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-SemiBold.abed79cd0df1827e18cf.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-Bold.118dea98980e20a81ced.woff2" as="font" type="font/woff2" crossorigin><title>Streamlit</title><script>window.prerenderReady=!1</script><script defer="defer" src="./static/js/main.d3201242.js"></script><link href="./static/css/main.bf304093.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
1
+ <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><link rel="shortcut icon" href="./favicon.png"/><link rel="preload" href="./static/media/SourceSansPro-Regular.0d69e5ff5e92ac64a0c9.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-SemiBold.abed79cd0df1827e18cf.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-Bold.118dea98980e20a81ced.woff2" as="font" type="font/woff2" crossorigin><title>Streamlit</title><script>window.prerenderReady=!1</script><script defer="defer" src="./static/js/main.3d71c26f.js"></script><link href="./static/css/main.bf304093.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>