def adapt_param_type(params):
    """Adapts provided params when a conversion is needed. For example, when
    passing a list parameter it should be converted to tuple in order for
    postgres to correctly interpret them as an array.
    """
    return {k: (tuple(v) if isinstance(v, list) else v) for (k, v) in params.items()}