Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch EcephysSession from SLIMS #38

Merged
merged 17 commits into from
Oct 4, 2024
Merged
5 changes: 3 additions & 2 deletions src/aind_slims_api/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ def fetch_models(
"""
resolved_kwargs = deepcopy(model._base_fetch_filters)
logger.debug("Resolved kwargs: %s", resolved_kwargs)

if isinstance(sort, str):
sort = [sort]

Expand All @@ -160,7 +161,7 @@ def fetch_models(
sort=resolved_sort,
start=start,
end=end,
**resolved_kwargs
**resolved_kwargs,
)
return self._validate_models(model, response)

Expand Down Expand Up @@ -189,7 +190,7 @@ def fetch_model(
if len(records) > 0:
logger.debug(f"Found {len(records)} records for {model}.")
if len(records) < 1:
raise SlimsRecordNotFound("No record found.")
raise SlimsRecordNotFound(f"No record found for {model} with {args}.")
return records[0]

@staticmethod
Expand Down
Loading
Loading