def test_table_exists(client, to_delete):
    """Determine if a table exists."""
    DATASET_ID = "get_table_dataset_{}".format(_millis())
    TABLE_ID = "get_table_table_{}".format(_millis())
    dataset = bigquery.Dataset(client.dataset(DATASET_ID))
    dataset = client.create_dataset(dataset)
    to_delete.append(dataset)

    table_ref = dataset.table(TABLE_ID)
    table = bigquery.Table(table_ref, schema=SCHEMA)
    table = client.create_table(table)

    assert table_exists(client, table_ref)
    assert not table_exists(client, dataset.table("i_dont_exist"))
def test_table_exists ( client , to_delete ) : DATASET_ID = "get_table_dataset_{}" . format ( _millis ( ) ) TABLE_ID = "get_table_table_{}" . format ( _millis ( ) ) dataset = bigquery . Dataset ( client . dataset ( DATASET_ID ) ) dataset = client . create_dataset ( dataset ) to_delete . append ( dataset ) table_ref = dataset . table ( TABLE_ID ) table = bigquery . Table ( table_ref , schema = SCHEMA ) table = client . create_table ( table ) assert table_exists ( client , table_ref ) assert not table_exists ( client , dataset . table ( "i_dont_exist" ) )
Determine if a table exists.