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

Unclear error when trying to pass pandas into perspective table #2847

Closed
timkpaine opened this issue Nov 14, 2024 · 0 comments · Fixed by #2848
Closed

Unclear error when trying to pass pandas into perspective table #2847

timkpaine opened this issue Nov 14, 2024 · 0 comments · Fixed by #2848
Labels

Comments

@timkpaine
Copy link
Member

timkpaine commented Nov 14, 2024

Feature Request

Description of Problem:

pyarrow is necessary for perspective to convert pandas data frames, but we do an unconditional import in rust code which leads to a clear error message but unclear stack trace (disappears inside the rust code so can't see clear usage of pyarrow).

import pandas as pd
from perspective.widget import PerspectiveWidget


df = pd.DataFrame({"a": [1,2,3]})
PerspectiveWidget(df)
Traceback (most recent call last):
  File "/Users/timkpaine/Library/Mobile Documents/com~apple~CloudDocs/Downloads/tmp/tmp.py", line 6, in <module>
    PerspectiveWidget(df)
  File "/opt/homebrew/lib/python3.11/site-packages/perspective/widget/__init__.py", line 155, in __init__
    self.load(data, **self._options)
  File "/opt/homebrew/lib/python3.11/site-packages/perspective/widget/__init__.py", line 160, in load
    super(PerspectiveWidget, self).load(data, **options)
  File "/opt/homebrew/lib/python3.11/site-packages/perspective/widget/viewer/viewer.py", line 199, in load
    self._table = perspective.table(data, name=name, **options)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/perspective/__init__.py", line 43, in table
    return GLOBAL_CLIENT.table(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'pyarrow'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant