You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@bokeh/jupyter_bokeh v2.0.3 enabled OK
@jupyter-widgets/jupyterlab-manager v2.0.0 enabled OK
@jupyterlab/hub-extension v2.2.0 enabled OK
@pyviz/jupyterlab_pyviz v1.0.4 enabled OK
jupyterlab-drawio v0.7.0 enabled OK
qgrid2 v1.1.3 enabled OK
Description of Issue
Widgets created using show_grid without specifying grid_options share a grid_option dict instance, such that changing an option for one will change it for the others.
Reproduction Steps
This will happen for any grid_option item.
In [2]: grid1=qgrid.show_grid(pd.DataFrame({'a':[1]}))
grid2=qgrid.show_grid(pd.DataFrame({'c':[5]}))
grid1.grid_options["maxVisibleRows"]
Out [2]: 15In [3]: grid2.grid_options["maxVisibleRows"]
Out [3]: 15In [4]: grid1.change_grid_option("maxVisibleRows", 9)
grid1.grid_options["maxVisibleRows"]
Out [4]: 9In [5]: grid2.grid_options["maxVisibleRows"]
Out [5]: 9
What steps have you taken to resolve this already?
This happens because new qgrid widgets instances are assigned the default grid_options dict, not a copy of that dict, within show_grid(), if the call doesn't include an argument for grid_options
Environment
You won't need this. I show below the lines of code that cause the issue.
Versions
python : 3.6.7.final.0
python-bits : 64
OS : Linux
OS-release : 4.14.193-149.317.amzn2.x86_64
machine : x86_64
processor : x86_64
qgrid :1.3.1
notebook: 6.1.3
jupyterlab:2.2.0
jupyterlab-launcher:0.13.1
jupyterlab-pygments:0.1.1
jupyterlab-server:1.2.0
Jupyter lab packages
@bokeh/jupyter_bokeh v2.0.3 enabled OK
@jupyter-widgets/jupyterlab-manager v2.0.0 enabled OK
@jupyterlab/hub-extension v2.2.0 enabled OK
@pyviz/jupyterlab_pyviz v1.0.4 enabled OK
jupyterlab-drawio v0.7.0 enabled OK
qgrid2 v1.1.3 enabled OK
Description of Issue
Widgets created using show_grid without specifying grid_options share a grid_option dict instance, such that changing an option for one will change it for the others.
Reproduction Steps
This will happen for any grid_option item.
What steps have you taken to resolve this already?
This happens because new qgrid widgets instances are assigned the default
grid_options
dict, not a copy of that dict, withinshow_grid()
, if the call doesn't include an argument forgrid_options
qgrid/qgrid/grid.py
Lines 484 to 493 in 877b420
The text was updated successfully, but these errors were encountered: