diff --git a/src/caoscrawler/identifiable_adapters.py b/src/caoscrawler/identifiable_adapters.py index 64b9d380111ce7f1886ba5c77d4d9ce140ae9e3d..dd520a5acf641d59798dc3e5ccdd35b701755590 100644 --- a/src/caoscrawler/identifiable_adapters.py +++ b/src/caoscrawler/identifiable_adapters.py @@ -27,8 +27,8 @@ from __future__ import annotations import logging from abc import ABCMeta, abstractmethod -from functools import lru_cache from datetime import datetime +from functools import lru_cache from typing import Any import caosdb as db @@ -44,7 +44,7 @@ logger = logging.getLogger(__name__) def get_children_of_rt(rtname): """Supply the name of a recordtype. This name and the name of all children RTs are returned in a list""" - return [p.name for p in cached_query(f"FIND RECORDTYPE {rtname}")] + return [p.name for p in cached_query(f"FIND RECORDTYPE '{rtname}'")] def convert_value(value: Any): @@ -477,8 +477,7 @@ class CaosDBIdentifiableAdapter(IdentifiableAdapter): return cached_get_entity_by(path=identifiable) if identifiable.path is None: raise RuntimeError("Path must not be None for File retrieval.") - candidates = db.execute_query("FIND File which is stored at '{}'".format( - identifiable.path)) + candidates = cached_get_entity_by(path=identifiable.path) if len(candidates) > 1: raise RuntimeError("Identifiable was not defined unambigiously.") if len(candidates) == 0: