Description
Describe the bug
hen open published app via web browser editor, I can see error 'Error executing script : 'value''
To Reproduce
Steps to reproduce the behavior:
-
Go to web browser
-
Add a threshold with value, which is not in your dataset
For example:
My table does not have 'value'
threshold = slider("Threshold", min_val=0, max_val=100, default=50) table(df[df["value"] > threshold], title="Dynamic Data View")
-
Open published app from your projects list
-
See error 'Error executing script : 'value''
Expected behavior
The preview should present the same error: 'Error executing script : 'value'' -
When I fix threshold by changing the value from table from 'value' to 'Humidity'
threshold = slider("Threshold", min_val=0, max_val=0, default=1) table(df[df["Humidity"] > threshold], title="Dynamic Data View")
-
The preview and published version work well
Environment:
- OS: [e.g. iOS]
- Browser: [e.g. chrome, safari]
- Version: [e.g. 22]
Additional context
My hello.py with value in threshold, which raised the error
from preswald import connect, get_df, query, table, text, slider, plotly, separator, playground
import plotly.express as px
text("# Weather History Analysis App")
connect() # Initialize connection to preswald.toml data sources
df = get_df("weatherhistory_csv") # Load data
text("## Plot: Temperature Humidity")
fig = px.scatter(df, x="Temperature (C)", y="Humidity", labels={"x": "Temperature", "y": "Humidity"}, title="Temperatury Humidity")
plotly(fig)
separator()
df = playground(
label="Humidity Filter",
query="SELECT Humidity, Summary FROM weatherhistory_csv WHERE Humidity > 0.7"
)
separator()
sql = "SELECT * FROM weatherhistory_csv WHERE Summary = 'Partly Cloudy'"
filtered_df = query(sql, "weatherhistory_csv")
text("## Filtered Data Where Summary is 'Partly Cloudy'")
table(filtered_df, title="Filtered Data")
threshold = slider("Threshold", min_val=0, max_val=100, default=50)
table(df[df["value"] > threshold], title="Dynamic Data View")
My hello.py, which works well for preview and publish
from preswald import connect, get_df, query, table, text, slider, plotly, separator, playground
import plotly.express as px
text("# Weather History Analysis App")
connect() # Initialize connection to preswald.toml data sources
df = get_df("weatherhistory_csv") # Load data
text("## Plot: Temperature Humidity")
fig = px.scatter(df, x="Temperature (C)", y="Humidity", labels={"x": "Temperature", "y": "Humidity"}, title="Temperatury Humidity")
plotly(fig)
separator()
df = playground(
label="Humidity Filter",
query="SELECT Humidity, Summary FROM weatherhistory_csv WHERE Humidity > 0.7"
)
separator()
sql = "SELECT * FROM weatherhistory_csv WHERE Summary = 'Partly Cloudy'"
filtered_df = query(sql, "weatherhistory_csv")
text("## Filtered Data Where Summary is 'Partly Cloudy'")
table(filtered_df, title="Filtered Data")
threshold = slider("Threshold", min_val=0, max_val=1, default=0.5)
table(df[df["Humidity"] > threshold], title="Dynamic Data View")