MCPcopy
hub / github.com/marimo-team/marimo / append

Method append

marimo/_runtime/params.py:122–146  ·  view source on GitHub ↗

Append a value to a list of values Args: key: The key identifying the list; the list will be created if needed. value: The value to append.

(self, key: str, value: str)

Source from the content-addressed store, hash-verified

120 self[key] = value
121
122 def append(self, key: str, value: str) -> None:
123 """Append a value to a list of values
124
125 Args:
126 key: The key identifying the list; the list will be created if needed.
127 value: The value to append.
128 """
129 if key not in self._params:
130 self._params[key] = value
131 broadcast_notification(
132 QueryParamsAppendNotification(key, value), self._stream
133 )
134 self._set_value(self._params)
135 return
136
137 current_value = self._params[key]
138 if isinstance(current_value, list):
139 current_value.append(value)
140 else:
141 self._params[key] = [current_value, value]
142
143 broadcast_notification(
144 QueryParamsAppendNotification(key, value), self._stream
145 )
146 self._set_value(self._params)
147
148 def remove(self, key: str, value: str | None = None) -> None:
149 """Remove a value from a list of values.

Callers 15

_extract_query_paramsMethod · 0.95
find_affected_filesFunction · 0.45
emitMethod · 0.45
hash_cell_groupFunction · 0.45
_set_contextMethod · 0.45
visitMethod · 0.45
get_batchMethod · 0.45
save_cacheMethod · 0.45
_dispatch_writeMethod · 0.45

Calls 2

broadcast_notificationFunction · 0.90

Tested by 15

summaryMethod · 0.36
appendFunction · 0.36
mainFunction · 0.36
working_factoryMethod · 0.36
broken_factoryMethod · 0.36
oneMethod · 0.36
test_side_effect_fileMethod · 0.36