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_convert_dataframe_to_cds fails #556

Closed
dhirschfeld opened this issue Jul 10, 2017 · 0 comments
Closed

test_convert_dataframe_to_cds fails #556

dhirschfeld opened this issue Jul 10, 2017 · 0 comments

Comments

@dhirschfeld
Copy link
Contributor

On win64/py36, bokeh 0.12.6, pandas 0.20.2 I'm seeing the below error:

________________________ test_convert_dataframe_to_cds ________________________

    def test_convert_dataframe_to_cds():
        cds = convert(ColumnDataSource, df)
>       assert cds.data == {'name': ['Alice', 'Bob', 'Charlie'],
                            'balance': [100, 200, 300]}

odo\backends\tests\test_bokeh.py:18:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = 0    True
1    True
2    True
Name: balance, dtype: bool

    def __nonzero__(self):
        raise ValueError("The truth value of a {0} is ambiguous. "
                         "Use a.empty, a.bool(), a.item(), a.any() or a.all()."
>                        .format(self.__class__.__name__))
E       ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

The test does seem to work on Travis though. I'm assuming it must be testing against an older version of bokeh or pandas?

If I inspect cds.data this is what I'm seeing:

In [49]: from odo.backends.bokeh import convert, pd, ColumnDataSource

In [50]: df = pd.DataFrame([[100, 'Alice'],
    ...:                    [200, 'Bob'],
    ...:                    [300, 'Charlie']],
    ...:                   columns=['balance', 'name'])

In [51]: cds = convert(ColumnDataSource, df)

In [52]: cds.data
Out[52]: 
{'balance': 0    100
 1    200
 2    300
 Name: balance, dtype: int64, 'name': 0      Alice
 1        Bob
 2    Charlie
 Name: name, dtype: object}
dhirschfeld pushed a commit to dhirschfeld/odo that referenced this issue Nov 6, 2017
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