Skip to content

Commit 061e83a

Browse files
authored
Merge pull request #2465 from ada-x64/bugs/jlab-version-bug
Fix Jupyterlab Widget Save/Restore Symmetry
2 parents f9237d7 + ac810d0 commit 061e83a

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

packages/perspective-jupyterlab/test/jupyter/widget.spec.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,20 @@ assert w.theme == "Pro Dark"
410410
}
411411
);
412412

413+
test_jupyter("Restores from saved config", [], async ({ page }) => {
414+
await execute_all_cells(page);
415+
let errored = await assert_no_error_in_cell(
416+
page,
417+
`
418+
table = perspective.Table(arrow_data)
419+
w = perspective.PerspectiveWidget(table)
420+
config = w.save()
421+
perpsective.PerspectiveWidget(df, **config)
422+
`
423+
);
424+
expect(errored).toBe(false);
425+
});
426+
413427
// *************************
414428
// UTILS
415429
// *************************

python/perspective/perspective/viewer/viewer.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ def __init__(
7676
settings=True,
7777
theme=None,
7878
title=None,
79+
# ignored, here for restore compatibility
80+
version=None,
7981
):
8082
"""Initialize an instance of `PerspectiveViewer` with the given viewer
8183
configuration. Do not pass a `Table` or data into the constructor -
@@ -107,6 +109,9 @@ def __init__(
107109
settings(:obj:`bool`): Whether the perspective query settings
108110
panel should be open.
109111
theme (:obj:`str`): The color theme to use.
112+
version (:obj:`str`): The version this configuration is restored from.
113+
This should only be used when restoring a configuration,
114+
and should not be set manually.
110115
111116
Examples:
112117
>>> viewer = PerspectiveViewer(

0 commit comments

Comments
 (0)