def _replace_bucket_unit(match_obj):
    """Replace the intern('unit') in `bucket()` with just the string
    literal, because the unit determines the return type of the column and the
    function would not be able to validate a unit if it was interned."""
    full = match_obj.group(0)
    interned = match_obj.group(1)
    unit = match_obj.group(2)

    # from "bucket(col, intern('unit'))" to "bucket(col, 'unit')"
    return "{0}'{1}')".format(full[0 : full.index(interned)], unit)