def METHOD_NAME(mapping):
    for key, value in mapping.items():
        if isinstance(value, list):
            if key == "tags":
                mapping[key] = ",".join(value)
            else:
                mapping[key] = "|".join(value)
        elif isinstance(value, datetime):
            mapping[key] = str(value)
    return mapping