modin-project / modin-project/modin

BUG: Bokeh ColumnDataSource incompatible with Modin

Open
#5,437 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug 🦗 Integration ➕➕ P2
Dominant language
Python
Stars
10.4k
Forks
677
PR merge metrics
No merged PRs in 30d

Description

Modin version checks
  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest released version of Modin.

  • I have confirmed this bug exists on the main branch of Modin. (In order to do this you can follow this guide.)

Reproducible Example
import modin.pandas as pd
from bokeh.plotting import figure
from bokeh.models import ColumnDataSource

data = pd.DataFrame.from_dict({'x_values': [1, 2, 3, 4, 5], 'y_values': [6, 7, 2, 3, 6]})

# create a ColumnDataSource by passing the dict
source = ColumnDataSource(data)

p = figure()
p.circle(x='x_values', y='y_values', source=source)
show(p)
Issue Description

ColumnDataSource() can currently only accept a dict or pandas.DataFrame.

Expected Behavior
Screen Shot 2022-12-14 at 10 06 13 AM
Error Logs

UserWarning: `from_dict` is not currently supported by PandasOnRay, defaulting to pandas implementation.
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[14], line 7
      4 data = pd.DataFrame.from_dict({'x_values': [1, 2, 3, 4, 5], 'y_values': [6, 7, 2, 3, 6]})
      6 # create a ColumnDataSource by passing the dict
----> 7 source = ColumnDataSource(data)
      9 p = figure()
     10 p.circle(x='x_values', y='y_values', source=source)

File ~/Desktop/ponder-integ/lib/python3.9/site-packages/bokeh/models/sources.py:238, in ColumnDataSource.__init__(self, *args, **kwargs)
    236         raw_data = self._data_from_groupby(raw_data)
    237     else:
--> 238         raise ValueError(f"expected a dict or pandas.DataFrame, got {raw_data}")
    239 super().__init__(**kwargs)
    240 self.data.update(raw_data)

ValueError: expected a dict or pandas.DataFrame, got    x_values  y_values
0         1         6
1         2         7
2         3         2
3         4         3
4         5         6



Installed Versions

INSTALLED VERSIONS

commit : 4114183f84d3d152126510655db5698fd4ea1071
python : 3.9.7.final.0
python-bits : 64
OS : Darwin
OS-release : 20.6.0
Version : Darwin Kernel Version 20.6.0: Wed Jun 23 00:26:31 PDT 2021; root:xnu-7195.141.2~5/RELEASE_X86_64
machine : x86_64
processor : i386
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8

Modin dependencies

modin : 0.18.0+3.g4114183f
ray : 2.0.1
dask : 2022.11.1
distributed : 2022.11.1
hdk : None

pandas dependencies

pandas : 1.5.2
numpy : 1.23.5
pytz : 2022.6
dateutil : 2.8.2
setuptools : 57.4.0
pip : 22.3.1
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.2
IPython : 8.7.0
pandas_datareader: None
bs4 : 4.11.1
bottleneck : None
brotli : None
fastparquet : None
fsspec : 2022.11.0
gcsfs : None
matplotlib : 3.6.2
numba : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 10.0.1
pyreadstat : None
pyxlsb : None
s3fs : 2022.11.0
scipy : 1.9.3
snappy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
zstandard : None
tzdata : None

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no repository files or tests. Start by running the provided Python example with Modin, pandas, and Bokeh, then trace how the Modin DataFrame reaches ColumnDataSource. Done means the example creates the source and plot without the reported ValueError, with regression coverage for this integration.

Written by the indexing model from the issue text.

Assessment

Tech stack
pandas, python
Domain
data, data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.