def METHOD_NAME(connection, schema=None, target_type="table"):
    """
    Depending on the targetType returns either the Views or Tables
    since they share the same method for getting their names.
    """
    query = "show tables"
    if schema:
        query += " IN " + schema
    cursor = connection.execute(query)
    results = cursor.fetchall()
    tables_and_views = [result[0] for result in results]
    retvalue = []
    for table_view in tables_and_views:
        query = f"describe formatted `{schema}`.`{table_view}`"
        cursor = connection.execute(query)
        results = cursor.fetchall()
        for result in list(results):
            data = result
            if data[0].strip() == "Table Type:":
                if target_type.lower() in data[1].lower():
                    retvalue.append(table_view)
    return retvalue