예제 #1
0
def test_create_fields_has_columns(config):
    del config["datasources"]["testdb2"]
    table_config = config["datasources"]["testdb1"]["tables"]["main.partners"]
    table_config["create_fields"] = True
    wh = Warehouse(config=config)
    assert wh.has_dimension("partner_id")
    assert wh.has_dimension("partner_name")
    assert not wh.has_dimension("partners_name")
    # This one is auto-generated with create_fields, so it has a default naming
    # style:
    assert wh.has_dimension("main_partners_created_at")
예제 #2
0
def test_warehouse_remote_json_table(adhoc_config):
    url = (
        "https://raw.githubusercontent.com/totalhack/zillion/master/tests/dma_zip.json"
    )
    adhoc_config["datasources"]["test_adhoc_db"]["tables"]["main.dma_zip"][
        "data_url"] = url
    wh = Warehouse(config=adhoc_config)
    assert wh.has_dimension("Zip_Code")
예제 #3
0
def test_warehouse_remote_google_sheet(adhoc_config):
    url = "https://docs.google.com/spreadsheets/d/1iCzY4av_tinUpG2Q0mQhbxd77XOREwfbPAVZPObzFeE/edit?usp=sharing"
    adhoc_config["datasources"]["test_adhoc_db"]["tables"]["main.dma_zip"][
        "data_url"] = url
    wh = Warehouse(config=adhoc_config)
    assert wh.has_dimension("Zip_Code")
예제 #4
0
def test_warehouse_remote_csv_table(adhoc_config):
    table_config = adhoc_config["datasources"]["test_adhoc_db"]["tables"][
        "main.dma_zip"]
    table_config["adhoc_table_options"] = {"nrows": 30}
    wh = Warehouse(config=adhoc_config)
    assert wh.has_dimension("Zip_Code")