Skip to content

[BUG][Web browser editor] When open published app via web browser editor, I can see error 'Error executing script : 'value'' and preview is working well #625

Open
@YauhenBichel

Description

@YauhenBichel

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:

  1. Go to web browser

  2. 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")

  3. Check that preview is workingImage

  4. Open published app from your projects list

  5. See error 'Error executing script : 'value''
    Expected behavior
    The preview should present the same error: 'Error executing script : 'value''

  6. 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")

  7. The preview and published version work well

Screenshots
Image

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")

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions