def test_join_exceptions():
    """
    exception raised for mismatched schema;
    exception raised for no shared fields
    """
    a = symbol('a', 'var * {x: int}')
    b = symbol('b', 'var * {x: string}')
    with pytest.raises(TypeError) as excinfo:
        join(a, b, 'x')

    assert "Schemata of joining columns do not match," in str(excinfo.value)
    assert "x=int32 and x=string" in str(excinfo.value)

    b = symbol('b', 'var * {z: int}')
    with pytest.raises(ValueError) as excinfo:
        join(a, b)

    assert "No shared columns between a and b" in str(excinfo.value)

    b = symbol('b', 'var * {x: int}')
    with pytest.raises(ValueError) as excinfo:
        join(a, b, how='inner_')

    assert "Got: inner_" in str(excinfo.value)
dataset/ETHPy150Open blaze/blaze/blaze/expr/tests/test_collections.py/test_join_exceptions/original