Open
Description
Plotly express doesn't seem to be working on @stlite/[email protected] and above. The latest working version is @stlite/[email protected].
I get the following error when trying to use plotly.express.line or plotly.express.bar for example:
TypeError: from_native() got an unexpected keyword argument 'pass_through'
Traceback:
File "streamlit/runtime/scriptrunner/exec_code.py", line 88, in exec_func_with_error_handling
File "streamlit/runtime/scriptrunner/script_runner.py", line 609, in code_to_exec
File "/home/pyodide/spinner_debug.py", line 23, in <module>
fig = px.bar(df, x=df.index, y=df.columns, title='Random Chart Plot')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lib/python3.12/site-packages/plotly/express/_chart_types.py", line 381, in bar
return make_figure(
^^^^^^^^^^^^
File "/lib/python3.12/site-packages/plotly/express/_core.py", line 2477, in make_figure
args = build_dataframe(args, constructor)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lib/python3.12/site-packages/plotly/express/_core.py", line 1727, in build_dataframe
df_output, wide_id_vars = process_args_into_dataframe(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lib/python3.12/site-packages/plotly/express/_core.py", line 1380, in process_args_into_dataframe
df_output[str(col_name)] = to_named_series(
^^^^^^^^^^^^^^^^
File "/lib/python3.12/site-packages/plotly/express/_core.py", line 1175, in to_named_series
x = nw.from_native(x, series_only=True, pass_through=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Example code to reproduce:
import streamlit as st
import plotly.express as px
import pandas as pd
import numpy as np
# Generate Random Dates
date_range = pd.date_range(start="2025-01-01", periods=10, freq='D')
# Create Random Column Names
chart_cols = [f'chart_col{i}' for i in range(1, 6)]
# Generate Random numerical values for the chart
values = np.random.randn(10, 5)
# Create the DataFrame
df = pd.DataFrame(values, columns=chart_cols, index=date_range)
# Create a plotly fig
fig = px.bar(df, x=df.index, y=df.columns, title='Random Chart Plot')
st.plotly_chart(fig)
Metadata
Assignees
Labels
No labels
Activity