Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failure #609

Open
FRidh opened this issue Mar 10, 2018 · 0 comments
Open

Test failure #609

FRidh opened this issue Mar 10, 2018 · 0 comments

Comments

@FRidh
Copy link

FRidh commented Mar 10, 2018

=================================== FAILURES ===================================
___________________ test_numpy_asserts_type_after_dataframe ____________________

    def test_numpy_asserts_type_after_dataframe():
        df = pd.DataFrame({'name': ['Alice'], 'amount': [100]})
        ds = datashape.dshape('1 * {name: string[10, "ascii"], amount: int32}')
>       x = convert(np.ndarray, df, dshape=ds)

odo/tests/test_convert.py:169:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
odo/core.py:44: in __call__
    return _transform(self.graph, *args, **kwargs)
odo/core.py:60: in _transform
    x = f(x, excluded_edges=excluded_edges, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

df =    amount   name
0     100  Alice
dshape = dshape("1 * {name: string[10, 'A'], amount: int32}")
kwargs = {'excluded_edges': set()}
dtype = dtype([('name', 'S10'), ('amount', '<i4')])
x = rec.array([(100, 'Alice')],
          dtype=[('amount', '<i8'), ('name', 'O')])

    @convert.register(np.ndarray, pd.DataFrame, cost=0.2)
    def dataframe_to_numpy(df, dshape=None, **kwargs):
        dtype = dshape_to_numpy(dshape or discover(df))
        x = df.to_records(index=False)
        if x.dtype != dtype:
>           x = x.astype(dtype)
E           ValueError: invalid literal for int() with base 10: 'Alice'

odo/convert.py:25: ValueError
===================== 1 failed, 84 passed in 2.12 seconds ======================
builder for '/nix/store/inpc9f06d29xnl71d2nxjjv2ybjgxwz8-python3.6-odo-0.5.1.drv' failed with exit code 1
error: build of '/nix/store/inpc9f06d29xnl71d2nxjjv2ybjgxwz8-python3.6-odo-0.5.1.drv' failed
@FRidh FRidh changed the title Test failures Test failure Mar 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant