Add docstrings

This commit is contained in:
Andras Schmelczer 2022-07-12 19:16:13 +02:00
parent a1846a240e
commit 8c7a31a513
No known key found for this signature in database
GPG key ID: 0EA1BC97D0AB076E
5 changed files with 110 additions and 23 deletions

View file

@ -7,9 +7,28 @@ from ..context import get_context
def delete_ground_truth(
conjunctive_tags: Union[List[str], str] = [],
*,
until: Optional[datetime] = None,
since: Optional[datetime] = None,
until: Optional[datetime] = None,
) -> None:
"""Delete traces matching the given criteria.
Takes the same arguments as `query_ground_truth` but instead of returning them,
it simply deletes them.
You can rely on the efficiency of the delete's implementation.
Examples:
>>> delete_ground_truth(['train', 'test', 'validation'])
Args:
conjunctive_tags: Single tag or a list of tags which the deleted traces have to
match. The relationship between the tags is conjunctive (AND).
since: Only delete traces created after the given timestamp. `None` means no
filtering.
until: Only delete traces created before the given timestamp. `None` means no
filtering.
"""
tags = (
conjunctive_tags if isinstance(conjunctive_tags, list) else [conjunctive_tags]
)