def METHOD_NAME(
    view, filter: Optional[Dict] = None, debug_mode=False, logger=None
):
    tql_filter = ""
    if filter is not None:
        if isinstance(filter, dict):
            for tensor in filter.keys():
                if tensor not in view.tensors:
                    raise ValueError(
                        f"Tensor '{tensor}' is not present in the Vector Store."
                    )
                if view[tensor].meta.htype == "json":
                    for key, value in filter[tensor].items():
                        val_str = f"'{value}'" if type(value) == str else f"{value}"
                        tql_filter += f"{tensor}['{key}'] == {val_str} and "
                else:
                    val_str = (
                        f"'{filter[tensor]}'"
                        if isinstance(filter[tensor], str)
                        or isinstance(filter[tensor], np.str_)
                        else f"{filter[tensor]}"
                    )
                    tql_filter += f"{tensor} == {val_str} and "
            tql_filter = tql_filter[:-5]
    if debug_mode and logger is not None:
        logger.warning(f"Converted tql string is: '{tql_filter}'")  # pragma: no cover
    return view, tql_filter