Skip to content
Snippets Groups Projects

Support giving a CachedElement in helper functions using the local cache

Merged Eva Bardou requested to merge cached-element-helpers into master
All threads resolved!
6 files
+ 180
20
Compare changes
  • Side-by-side
  • Inline
Files
6
@@ -4,6 +4,7 @@ import os
from apistar.exceptions import ErrorResponse
from arkindex_worker import logger
from arkindex_worker.cache import CachedElement
from arkindex_worker.models import Element
@@ -65,8 +66,8 @@ class ClassificationMixin(object):
Create a classification on the given element through API
"""
assert element and isinstance(
element, Element
), "element shouldn't be null and should be of type Element"
element, (Element, CachedElement)
), "element shouldn't be null and should be an Element or CachedElement"
assert ml_class and isinstance(
ml_class, str
), "ml_class shouldn't be null and should be of type str"
Loading