Exemple #1
0
def test_join_column_names(join_type):
    """Test that join column_names attribute is correct"""
    t = Table("events.calls_20160101")
    joined = t.join(t, on_left="msisdn", how=join_type)
    cols = t.column_names
    cols.remove("msisdn")
    expected = ["msisdn"] + cols + [f"{c}" for c in cols]
    assert expected == joined.column_names
def test_join_column_names(join_type):
    """Test that join column_names attribute is correct"""
    t = Table("events.calls_20160101", columns=["location_id", "datetime"])
    t2 = Table("infrastructure.cells", columns=["id", "geom_point"])
    joined = t.join(t2, on_left="location_id", on_right="id", how=join_type)

    expected = [
        "location_id" if join_type in ("left", "inner",
                                       "left outer") else "id",
        "datetime",
        "geom_point",
    ]
    assert joined.column_names == expected