quantopian/qgrid

OverflowError: Maximum recursion level reached with all dataframes

ccowin opened this issue · 0 comments

Howdy,

I'm pretty new to python and don't really have the knowledge to properly diagnose what I'm doing wrong. Everything I try and use in Pandas work, but when I try to put it in a qgrid it enters a recursion loop and then eventually does an exception and fails.
Qgrid looks pretty slick, I think it would help me transition from excel to python effectively, but can't get it to run.

Environment

  • Operating System: Ubuntu 20.04
  • Python Version: 3.7.7
  • How did you install Qgrid: pip
  • Python packages: Apologies for the length:
alembic==1.4.3
asn1crypto==0.24.0
async-generator==1.10
attrs==20.2.0
backcall==0.2.0
bleach==3.2.1
branca==0.4.1
cachetools==4.1.1
certifi==2020.6.20
certipy==0.1.3
cffi==1.12.3
chardet==3.0.4
click==7.1.2
click-plugins==1.1.1
cligj==0.7.0
conda==4.9.0
conda-package-handling==1.3.11
cryptography==2.7
decorator==4.4.2
defusedxml==0.6.0
entrypoints==0.3
Fiona==1.8.17
folium==0.11.0
GDAL==3.1.3
geopandas==0.8.1
google-api-core==1.23.0
google-auth==1.22.1
google-cloud-core==1.4.3
google-cloud-storage==1.32.0
google-crc32c==1.0.0
google-resumable-media==1.1.0
googleapis-common-protos==1.52.0
idna==2.8
importlib-metadata==2.0.0
ipykernel==5.3.4
ipython==7.18.1
ipython-genutils==0.2.0
ipywidgets==7.5.1
jedi==0.17.2
Jinja2==2.11.2
json5==0.9.5
jsonschema==3.2.0
jupyter-client==6.1.7
jupyter-contrib-core==0.3.3
jupyter-contrib-nbextensions==0.5.1
jupyter-core==4.6.3
jupyter-highlight-selected-word==0.2.0
jupyter-latex-envs==1.4.6
jupyter-nbextensions-configurator==0.4.1
jupyterhub==1.0.0
jupyterlab==2.2.9
jupyterlab-pygments==0.1.2
jupyterlab-server==1.2.0
libarchive-c==2.8
lxml==4.6.1
Mako==1.1.3
MarkupSafe==1.1.1
mistune==0.8.4
munch==2.5.0
nbclient==0.5.1
nbconvert==6.0.7
nbformat==5.0.8
nbgitpuller==0.7.2
nbresuse==0.3.6
nest-asyncio==1.4.1
notebook==6.0.3
nteract-on-jupyter==2.1.3
numpy==1.19.2
oauthlib==3.1.0
packaging==20.4
pamela==1.0.0
pandas==1.1.3
pandocfilters==1.4.2
parso==0.7.1
pexpect==4.8.0
pickleshare==0.7.5
prometheus-client==0.8.0
prompt-toolkit==3.0.8
protobuf==3.13.0
psutil==5.7.2
ptyprocess==0.6.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycosat==0.6.3
pycparser==2.19
Pygments==2.7.1
pyOpenSSL==19.0.0
pyparsing==2.4.7
pyproj==2.6.1.post1
pyrsistent==0.17.3
PySocks==1.7.0
python-dateutil==2.8.1
python-editor==1.0.4
pytz==2020.1
PyYAML==5.3.1
pyzmq==19.0.2
qgrid==1.3.1
requests==2.24.0
rsa==4.6
Rtree==0.9.4
ruamel-yaml==0.15.46
Send2Trash==1.5.0
Shapely==1.7.1
six==1.15.0
SQLAlchemy==1.3.20
terminado==0.9.1
testpath==0.4.4
tornado==5.1.1
tqdm==4.32.1
traitlets==5.0.5
urllib3==1.24.2
wcwidth==0.2.5
webencodings==0.5.1
widgetsnbextension==3.5.1
zipp==3.3.1
  • Jupyter lab packages (if applicable):
 app dir: /opt/tljh/user/share/jupyter/lab    
        @jupyter-widgets/jupyterlab-manager v2.0.0  enabled  OK    
        @jupyterlab/geojson-extension v2.0.1  enabled  OK    
        qgrid2 v1.1.3  enabled  OK

Description of Issue

  • What did you expect to happen?
    A qtile to load in my jupyterlab instance.

  • What happened instead?
    OverflowError: Maximum recursion level reached exception

Reproduction Steps

  1. Installed a fresh The Littlest JupyterHub on a Google Cloud VM. Followed this guide pretty closely.
  2. (dont think this is relevant but installed all the above python libraries)
  3. Dowloaded a shapefile of all the US States from TIGER.
  4. Used the following code
import geopandas
import qgrid


gdf = geopandas.read_file('/path/to/file')
df = pandas.DataFrame(gdf)

qg = qgrid.show_grid(df, show_toolbar=True)
qg 

What steps have you taken to resolve this already?

  1. Tried with both pandas and geopandas
  2. Tried a different shapefile, geojson, and dataframe but all resulted in the same error.

Anything else?

Here is the error traceback:

---------------------------------------------------------------------------
OverflowError                             Traceback (most recent call last)
<ipython-input-5-def445dccd65> in <module>
      8 display(df.head())
      9 
---> 10 qg = qgrid.show_grid(df, show_toolbar=True)
     11 qg

/opt/tljh/user/lib/python3.7/site-packages/qgrid/grid.py in show_grid(data_frame, show_toolbar, precision, grid_options, column_options, column_definitions, row_edit_callback)
    509                        column_definitions=column_definitions,
    510                        row_edit_callback=row_edit_callback,
--> 511                        show_toolbar=show_toolbar)
    512 
    513 

/opt/tljh/user/lib/python3.7/site-packages/qgrid/grid.py in __init__(self, *args, **kwargs)
    625 
    626         if self.df is not None:
--> 627             self._update_df()
    628 
    629     def _grid_options_default(self):

/opt/tljh/user/lib/python3.7/site-packages/qgrid/grid.py in _update_df(self)
    818         self._unfiltered_df = self._df.copy()
    819 
--> 820         self._update_table(update_columns=True, fire_data_change_event=False)
    821         self._ignore_df_changed = False
    822 

/opt/tljh/user/lib/python3.7/site-packages/qgrid/grid.py in _update_table(self, update_columns, triggered_by, scroll_to_row, fire_data_change_event)
    961                                   orient='table',
    962                                   date_format='iso',
--> 963                                   double_precision=self.precision)
    964 
    965         if update_columns:

/opt/tljh/user/lib/python3.7/site-packages/pandas/io/json/_json.py in to_json(path_or_buf, obj, orient, date_format, double_precision, force_ascii, date_unit, default_handler, lines, compression, index, indent)
     82         default_handler=default_handler,
     83         index=index,
---> 84         indent=indent,
     85     ).write()
     86 

/opt/tljh/user/lib/python3.7/site-packages/pandas/io/json/_json.py in write(self)
    142             self.date_format == "iso",
    143             self.default_handler,
--> 144             self.indent,
    145         )
    146 

/opt/tljh/user/lib/python3.7/site-packages/pandas/io/json/_json.py in _write(self, obj, orient, double_precision, ensure_ascii, date_unit, iso_dates, default_handler, indent)
    339             iso_dates,
    340             default_handler,
--> 341             indent,
    342         )
    343 

/opt/tljh/user/lib/python3.7/site-packages/pandas/io/json/_json.py in _write(self, obj, orient, double_precision, ensure_ascii, date_unit, iso_dates, default_handler, indent)
    242             iso_dates,
    243             default_handler,
--> 244             indent,
    245         )
    246 

/opt/tljh/user/lib/python3.7/site-packages/pandas/io/json/_json.py in _write(self, obj, orient, double_precision, ensure_ascii, date_unit, iso_dates, default_handler, indent)
    164             iso_dates=iso_dates,
    165             default_handler=default_handler,
--> 166             indent=indent,
    167         )
    168 

OverflowError: Maximum recursion level reached