dara-core 1.21.0__py3-none-any.whl → 1.21.1__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.
dara/core/defaults.py CHANGED
@@ -34,7 +34,7 @@ from dara.core.interactivity.actions import (
34
34
  UpdateVariableDef,
35
35
  )
36
36
  from dara.core.internal.cache_store import CacheStore
37
- from dara.core.router import Link, LinkDef, Outlet, OutletDef
37
+ from dara.core.router import Link, LinkDef, MenuLink, MenuLinkDef, Outlet, OutletDef
38
38
  from dara.core.visual.components import (
39
39
  DefaultFallbackDef,
40
40
  DynamicComponent,
@@ -44,8 +44,6 @@ from dara.core.visual.components import (
44
44
  ForDef,
45
45
  Menu,
46
46
  MenuDef,
47
- MenuLink,
48
- MenuLinkDef,
49
47
  PoweredByCausalens,
50
48
  PoweredByCausalensDef,
51
49
  ProgressTracker,
dara/core/definitions.py CHANGED
@@ -123,7 +123,7 @@ class ComponentInstance(BaseModel):
123
123
  Definition of a Component Instance
124
124
  """
125
125
 
126
- uid: Optional[str] = Field(default_factory=lambda: str(uuid.uuid4()))
126
+ uid: str = Field(default_factory=lambda: str(uuid.uuid4()))
127
127
 
128
128
  js_module: ClassVar[Optional[str]] = None
129
129
  """
@@ -284,7 +284,7 @@ class Variable(ClientVariable, Generic[VariableType]):
284
284
  assert isinstance(self.store, BackendStore), 'This method can only be used with a BackendStore'
285
285
  return await self.store.write(value, notify=notify, ignore_channel=ignore_channel)
286
286
 
287
- async def write_partial(self, data: Union[List[Dict[str, Any]], Any], notify: bool = True):
287
+ async def write_partial(self, data: Union[List[Dict[str, Any]], Any], notify: bool = True, in_place: bool = False):
288
288
  """
289
289
  Apply partial updates to the variable's BackendStore using JSON Patch operations or automatic diffing.
290
290
  Raises an error if the variable does not have a BackendStore attached.
@@ -294,9 +294,13 @@ class Variable(ClientVariable, Generic[VariableType]):
294
294
 
295
295
  :param data: Either a list of JSON patch operations (RFC 6902) or a full object to diff against current value
296
296
  :param notify: whether to broadcast the patches to clients
297
+ :param in_place: whether to apply the patches in-place or return a new value.
298
+ When set to True, the value will be mutated when applying the patches rather than deep-cloned.
299
+ This is recommended when the updated value is large and deep-cloning it can be expensive; however, users should exercise
300
+ caution when using the option as previous results retrieved from `variable.read()` will potentially be mutated, depending on the backend used.
297
301
  """
298
302
  assert isinstance(self.store, BackendStore), 'This method can only be used with a BackendStore'
299
- return await self.store.write_partial(data, notify=notify)
303
+ return await self.store.write_partial(data, notify=notify, in_place=in_place)
300
304
 
301
305
  async def read(self):
302
306
  """