Skip to content

Commit 64085ab

Browse files
Add UpdatePayload and DeleteRequest to arcticdb. import path (#2664)
#### Reference Issues/PRs <!--Example: Fixes #1234. See also #3456.--> #### What does this implement or fix? * Moved `UpdatePayload` and `DeleteRequest` to `arcticdb` import. * Updated the docs so that `UpdatePayload` and `DeleteRequest` are clickable * Added docstrings to `UpdatePayload` Proof * Now showing `arcticdb.` import on hover <img width="1243" height="563" alt="image" src="https://github.com/user-attachments/assets/ea5dc467-5ba9-4f53-a16c-a81f89239a6d" /> * Clicking it shows the docstrings for the structure Same for DeleteRequest
1 parent 0076efd commit 64085ab

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

docs/mkdocs/docs/api/library_types.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
::: arcticdb.ReadRequest
66

7+
::: arcticdb.DeleteRequest
8+
79
::: arcticdb.version_store.library.SymbolDescription
810

911
::: arcticdb.version_store.library.SymbolVersion
@@ -15,3 +17,8 @@
1517
::: arcticdb.version_store.library.VersionInfo
1618

1719
::: arcticdb.WritePayload
20+
21+
::: arcticdb.UpdatePayload
22+
23+
::: arcticdb.WriteMetadataPayload
24+

python/arcticdb/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
from arcticdb_ext.exceptions import ErrorCode, ErrorCategory
1515
from arcticdb.version_store.library import (
1616
WritePayload,
17+
UpdatePayload,
1718
ReadInfoRequest,
1819
ReadRequest,
20+
DeleteRequest,
1921
col,
2022
LazyDataFrame,
2123
LazyDataFrameCollection,

python/arcticdb/version_store/library.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,13 +347,39 @@ def __repr__(self):
347347

348348

349349
class UpdatePayload:
350+
"""
351+
UpdatePayload is designed to enable batching of multiple operations with an API that mirrors the singular
352+
``update`` API.
353+
354+
Construction of ``UpdatePayload`` objects is only required for batch update operations.
355+
356+
One instance of ``UpdatePayload`` refers to one unit that can be written through to ArcticDB.
357+
358+
"""
359+
350360
def __init__(
351361
self,
352362
symbol: str,
353363
data: NormalizableType,
354364
metadata: Any = None,
355365
date_range: Optional[Tuple[Optional[Timestamp], Optional[Timestamp]]] = None,
356366
):
367+
"""
368+
Constructor.
369+
370+
Parameters
371+
----------
372+
symbol : str
373+
Symbol name. Limited to 255 characters. The following characters are not supported in symbols:
374+
``"*", "&", "<", ">"``
375+
data : NormalizableType
376+
Time-indexed data to use for the update.
377+
metadata : Any, default=None
378+
Optional metadata to persist along with the new symbol version.
379+
date_range : Optional[Tuple[Optional[Timestamp], Optional[Timestamp]]], default=None
380+
Restricts the update to the specified range in the stored data. Leaving either bound as ``None`` leaves that
381+
side of the range open-ended.
382+
"""
357383
self.symbol = symbol
358384
self.data = data
359385
self.metadata = metadata
@@ -1420,7 +1446,7 @@ def update_batch(
14201446
Parameters
14211447
----------
14221448
update_payloads: List[UpdatePayload]
1423-
List `arcticdb.library.UpdatePayload`. Each element of the list describes an update operation for a
1449+
List of `UpdatePayload`. Each element of the list describes an update operation for a
14241450
particular symbol. Providing the symbol name, data, etc. The same symbol should not appear twice in this
14251451
list.
14261452
prune_previous_versions: bool, default=False

0 commit comments

Comments
 (0)