Skip to content

columns_config not supported in Jupyter PerspectiveWidget, PerspectiveViewer #3104

@jonioni

Description

@jonioni

Bug Report

Steps to Reproduce:

  1. Open latest Jupyter Notebook (7.5.1) with Python Kernel (3.13)
  2. Install latest perspective-python (4.0.1)
  3. Import PerspectiveWidget from perspective.widget
  4. Create PerspectiveWidget with columns_config={...} constructor arg
  5. Got error: TypeError: PerspectiveViewer.__init__() got an unexpected keyword argument 'columns_config'
from perspective.widget import PerspectiveWidget

widget = PerspectiveWidget(
  ...
  columns_config={
    ...
  }
)

Expected Result:

Be able to use columns_config to customize Perspective widget in Jupyter Notebook environment.

Actual Result:

Got the error:

File ~/notebook/.venv/lib/python3.12/site-packages/perspective/widget/__init__.py:198, in PerspectiveWidget.__init__(self, data, index, limit, binding_mode, **kwargs)
    182     raise TypeError("Index and Limit cannot be set at the same time!")
    184 # Parse the dataset we pass in - if it's Pandas, preserve pivots
    185 # if isinstance(data, pandas.DataFrame) or isinstance(data, pandas.Series):
    186 #     data, config = deconstruct_pandas(data)
   (...)    196 
    197 # Initialize the viewer
--> 198 super(PerspectiveWidget, self).__init__(**kwargs)
    200 # Handle messages from the the front end
    201 self.on_msg(self.handle_message)

File ~/notebook/.venv/lib/python3.12/site-packages/ipywidgets/widgets/widget.py:503, in Widget.__init__(self, **kwargs)
    501 """Public constructor"""
    502 self._model_id = kwargs.pop('model_id', None)
--> 503 super().__init__(**kwargs)
    505 Widget._call_widget_constructed(self)
    506 self.open()

TypeError: PerspectiveViewer.__init__() got an unexpected keyword argument 'columns_config'

No JavaScript or WebSocket involved. Native Perspective support for Jupyter Notebook (PerspectiveWidget) from latest version 4.0.1.

Environment:

For Python

  • python interpreter version: 3.13
  • package manager and version (conda/pip/*): pip
  • Platform and version (Jupyter/tornado/lib/*): Jupyter
  • OS: Linux
  • Browser: Chrome

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions