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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
YauhenBichel opened this issue Apr 6, 2025 · 1 comment · May be fixed by #737
Labels
bug Something isn't working

Comments

@YauhenBichel
Copy link

YauhenBichel commented Apr 6, 2025

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")
@YauhenBichel YauhenBichel added the bug Something isn't working label Apr 6, 2025
@YauhenBichel YauhenBichel changed the title [BUG] When open published app via web browser editor, I can see error 'Error executing script : 'value'' [BUG][Web browser editor] When open published app via web browser editor, I can see error 'Error executing script : 'value'' Apr 6, 2025
@YauhenBichel YauhenBichel changed the title [BUG][Web browser editor] When open published app via web browser editor, I can see error 'Error executing script : 'value'' [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 Apr 6, 2025
@shivam-singhal
Copy link
Member

@YauhenBichel are you still seeing this error?

sambhavnoobcoder added a commit to sambhavnoobcoder/preswald that referenced this issue May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants