jina.drivers.querylang.queryset.helper

jina.drivers.querylang.queryset.helper.iff(precond, val, f)[source]

If and only if the precond is True

Shortcut function for precond(val) and f(val). It is mainly used to create partial functions for commonly required preconditions

:param precond : (function) represents the precondition :param val : (mixed) value to which the functions are applied :param f : (function) the actual function

Return type

bool

jina.drivers.querylang.queryset.helper.iff_not_none(val: Union[int, str], f: Callable) → bool

If and only if the precond is True

Shortcut function for precond(val) and f(val). It is mainly used to create partial functions for commonly required preconditions

:param precond : (function) represents the precondition :param val : (mixed) value to which the functions are applied :param f : (function) the actual function

jina.drivers.querylang.queryset.helper.guard_type(classinfo, val)[source]
Return type

Union[str, List[int]]

jina.drivers.querylang.queryset.helper.guard_str(val: Union[str, List[int]]) → Union[str, List[int]]
jina.drivers.querylang.queryset.helper.guard_iter(val: Union[str, List[int]]) → Union[str, List[int]]
jina.drivers.querylang.queryset.helper.guard_int(val: Union[str, List[int]]) → Union[str, List[int]]