Skip to content

AttributeError: module 'pyarrow' has no attribute 'ChunkedArray' on Patch Demo #45

@robjharrison

Description

@robjharrison

Happened to notice this.
https://patch.datatoinsight.org/app?file=https://raw.githubusercontent.com/data-to-insight/patch/main/apps/009_PATCh_demo/app.py&req=plotly

:Logging for ref, as no time to look further atm.
Might be a lib ver incompatibility issue - pyodide? Pyarrow.

Error:
AttributeError: module 'pyarrow' has no attribute 'ChunkedArray'
Traceback:
File "/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 557, in _run_script
exec(code, module.dict)
File "/home/pyodide/app.py", line 61, in
fig = px.line(df, x="time_period", y="number", title=f"{chart_title}")
File "/lib/python3.10/site-packages/plotly/express/_chart_types.py", line 270, in line
return make_figure(args=locals(), constructor=go.Scatter)
File "/lib/python3.10/site-packages/plotly/express/_core.py", line 2755, in make_figure
fig.add_traces(frame_list[0]["data"] if len(frame_list) > 0 else [])
File "/lib/python3.10/site-packages/plotly/graph_objs/_figure.py", line 992, in add_traces
return super(Figure, self).add_traces(
File "/lib/python3.10/site-packages/plotly/basedatatypes.py", line 2191, in add_traces
data = self._data_validator.validate_coerce(data)
File "/lib/python3.10/site-packages/_plotly_utils/basevalidators.py", line 2713, in validate_coerce
trace = self.get_trace_class(trace_type)(
File "/lib/python3.10/site-packages/plotly/graph_objs/_scatter.py", line 3634, in init
self["x"] = _v
File "/lib/python3.10/site-packages/plotly/basedatatypes.py", line 4860, in setitem
self._set_prop(prop, value)
File "/lib/python3.10/site-packages/plotly/basedatatypes.py", line 5199, in _set_prop
val = validator.validate_coerce(val)
File "/lib/python3.10/site-packages/_plotly_utils/basevalidators.py", line 410, in validate_coerce
v = copy_to_readonly_numpy_array(v)
File "/lib/python3.10/site-packages/_plotly_utils/basevalidators.py", line 97, in copy_to_readonly_numpy_array
v = nw.from_native(v, allow_series=True, pass_through=True)
File "/lib/python3.10/site-packages/narwhals/stable/v1/init.py", line 1620, in from_native
result = _from_native_impl(
File "/lib/python3.10/site-packages/narwhals/translate.py", line 626, in _from_native_impl
elif is_pyarrow_chunked_array(native_object):
File "/lib/python3.10/site-packages/narwhals/dependencies.py", line 218, in is_pyarrow_chunked_array
return (pa := get_pyarrow()) is not None and isinstance(ser, pa.ChunkedArray)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions