Skip to content

Commit

Permalink
Merge pull request #2465 from ada-x64/bugs/jlab-version-bug
Browse files Browse the repository at this point in the history
Fix Jupyterlab Widget Save/Restore Symmetry
  • Loading branch information
texodus authored Dec 12, 2023
2 parents f9237d7 + ac810d0 commit 061e83a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/perspective-jupyterlab/test/jupyter/widget.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,20 @@ assert w.theme == "Pro Dark"
}
);

test_jupyter("Restores from saved config", [], async ({ page }) => {
await execute_all_cells(page);
let errored = await assert_no_error_in_cell(
page,
`
table = perspective.Table(arrow_data)
w = perspective.PerspectiveWidget(table)
config = w.save()
perpsective.PerspectiveWidget(df, **config)
`
);
expect(errored).toBe(false);
});

// *************************
// UTILS
// *************************
Expand Down
5 changes: 5 additions & 0 deletions python/perspective/perspective/viewer/viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ def __init__(
settings=True,
theme=None,
title=None,
# ignored, here for restore compatibility
version=None,
):
"""Initialize an instance of `PerspectiveViewer` with the given viewer
configuration. Do not pass a `Table` or data into the constructor -
Expand Down Expand Up @@ -107,6 +109,9 @@ def __init__(
settings(:obj:`bool`): Whether the perspective query settings
panel should be open.
theme (:obj:`str`): The color theme to use.
version (:obj:`str`): The version this configuration is restored from.
This should only be used when restoring a configuration,
and should not be set manually.
Examples:
>>> viewer = PerspectiveViewer(
Expand Down

0 comments on commit 061e83a

Please sign in to comment.