Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

edit cell value issues when column name has special characters #470

Closed
TC500 opened this issue Apr 27, 2021 · 2 comments
Closed

edit cell value issues when column name has special characters #470

TC500 opened this issue Apr 27, 2021 · 2 comments

Comments

@TC500
Copy link

TC500 commented Apr 27, 2021

import pandas as pd
import dtale
import dtale.app as dtale_app
dtale_app.JUPYTER_SERVER_PROXY = True
PROXY_ROOT='/mtjupyter/user/xxx/'
df = pd.DataFrame({'-.:?\/|test':[1,2,3]})
dtale.show(df,notebook=True,ignore_duplicate=True,app_root=PROXY_ROOT)

when i edit cell value, something like A1 from 1 to 0, the backend raise exception below:

Traceback (most recent call last):
  File "/conda/envs/notebook/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2898, in get_loc
    return self._engine.get_loc(casted_key)
  File "pandas/_libs/index.pyx", line 70, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/index.pyx", line 101, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/hashtable_class_helper.pxi", line 1675, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas/_libs/hashtable_class_helper.pxi", line 1683, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: '-.:'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/docker/ebs/py36env_zip_unarchive/notebook/lib/python3.6/site-packages/dtale/views.py", line 99, in _handle_exceptions
    return func(*args, **kwargs)
  File "/docker/ebs/py36env_zip_unarchive/notebook/lib/python3.6/site-packages/dtale/views.py", line 2086, in edit_cell
    dtype = find_dtype(data[column])
  File "/conda/envs/notebook/lib/python3.6/site-packages/pandas/core/frame.py", line 2906, in __getitem__
    indexer = self.columns.get_loc(key)
  File "/conda/envs/notebook/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2900, in get_loc
    raise KeyError(key) from err
KeyError: '-.:'
@aschonfeld
Copy link
Collaborator

@TC500 I'm sorry about that. I was hoping I wouldn't have to patch my API endpoints but it looks like I do. I've gone through the code and modified any endpoint which included a column name in the URI path and instead passed it as a URL parameter. That should solve this issue. Should have a release out later today:

complex_name_edit.mov

Thanks for your patience

@aschonfeld
Copy link
Collaborator

Just released v1.44.1 to pypi with this fix. Should be on conda-forge soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants