Skip to content

Commit

Permalink
imporove crud docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
diitaz93 committed Jan 29, 2025
1 parent 36b0cda commit 6983ad8
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions cg/store/crud/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@ def get_cases_by_customers_action_and_case_search(
limit (int | None, default=30): The maximum number of cases to return.
offset (int, default=0): The offset to start returning cases by.
Returns:
list[Case]: A list of filtered cases sorted by creation time and limited by the specified number.
tuple[list[Case], int]: A list of filtered cases sorted by creation time and truncated
by the limit parameter, and the total number of samples before truncation.
"""
filter_functions: list[Callable] = [
CaseFilter.BY_CUSTOMER_ENTRY_IDS,
Expand Down Expand Up @@ -621,14 +622,23 @@ def get_samples_by_customers_and_pattern(
self,
*,
customers: list[Customer] | None = None,
pattern: str = None,
pattern: str | None = None,
limit: int = 50,
offset: int = 0,
) -> tuple[list[Sample], int]:
"""
Return the samples by customer and internal id or name pattern, plus the total number of
samples matching the filter criteria. A limit and offset can be applied to the query for
pagination purposes.
Args:
customers (list[Customer] | None): A list of customer objects to filter cases by.
pattern (str | None): The sample internal id or name pattern to search for.
limit (int | None, default=30): The maximum number of cases to return.
offset (int, default=0): The offset to start returning cases by.
Returns:
tuple[list[Sample], int]: A list of filtered samples truncated by the limit parameter
and the total number of samples before truncation.
"""
samples: Query = self._get_query(table=Sample)
filter_functions: list[SampleFilter] = []
Expand Down

0 comments on commit 6983ad8

Please sign in to comment.