-
Notifications
You must be signed in to change notification settings - Fork 799
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
Schemapi debug mode always on? #2850
Comments
Thanks for reporting this! Having
I proposed a rework of the validation over at #2842 and I'm wondering if we still need this validation upon creation of objects. The error messages are now informative without it so that's no longer a relevant concern but it provides error messages sooner when you create certain objects before you display them which can be nice. @velochy Do you have any performance measurements you can share? I'd very much appreciate this to get a better understanding of how much this feature slows users down. What do you mean with "significant amount of rendering time"? How does this compare to setting |
I used the stocks = data.stocks.url
highlight = alt.selection_point(name="highlight", on="mouseover", clear="mouseout")
line = (
alt.Chart(height=100, width=200)
.mark_line(point=True)
.encode(x=alt.X("date:N", timeUnit="year"), y=alt.Y("mean(price):Q"))
)
rect = (
alt.Chart(width=200)
.mark_rect()
.encode(
x=alt.X("date:T", timeUnit="year"),
fill=alt.Y("mean(price):Q"),
stroke=alt.condition(
highlight, alt.value("black"), alt.value(None), empty=False
),
)
.add_params(highlight)
)
alt.vconcat(line, rect, data=stocks) The advantage of the immediate validation with highlight = alt.selection_point(name="highlight", on="mouseover", clear="mouseout", unknown="test") altair.vegalite.v5.schema.core.PointSelectionConfig, validating 'additionalProperties'
Additional properties are not allowed ('unknown' was unexpected) |
Indeed, thanks! Edited my comment. |
I was debugging some performance issues in my streamlit application and noticed that Altair schema validation is taking a significant amount of rendering time.
So I dug into the altair code and noticed something rather odd in
altair/utils/schemapi.py
, row 23-33So if I read it correctly, debug mode is set by default, and "disable_debug_mode()" will fail to disable it.
Its hard to believe this is intended behavior, but I'd prefer someone who understand the codebase better have a look.
The text was updated successfully, but these errors were encountered: