def _format_key(key):
    """Format table key `key` to a string."""
    schema, table = key

    table = table or "(FACT)"

    if schema:
        return "{}.{}".format(schema, table)
    else:
        return table