-
Notifications
You must be signed in to change notification settings - Fork 83
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
Shiny Express errors when trying to render DuckDBPyConnection
object
#1771
Comments
I have a feeling that we could go all the way to the other side of the spectrum from where we are currently and only include things in the UI that are tagifiable or literal strings. Are there any other classes of objects that we automatically render in any meaningful way? |
Looking back at the code for Each time there's a from shiny.express import ui
with ui.div():
"Hello"
ui.input_text("in", "Enter text") This translates to: from shiny import ui
ui.div("Hello", ui.input_text("in", "Enter text")) All of the content in a Shiny Express app is in an implicitly-defined top-level recall context manager. This is by default In the example above, values from each line in the The way that It might make sense to implement some sort of checking of the values before passing them to the function, but I think it would have to be customized for each function -- |
@wch With a small change (see #1773), we could simply not accumulate objects that aren't strings, simple scalars, or things that are convertible to renderable objects. It would make the example in this thread work out of the box without work-arounds. I also think it ends up being a bit more in line with what you'd expect in Express. The PR is in draft but all of our tests pass; feel free to check it out and leave thoughts there if you have time. |
The following app crashes on start because of the
con.register()
at the top level. Live app. (It could be suppressed by usingwith ui.hold():
.)The error message is:
Shiny tries to render the object, but fails. A few possible ways of dealing with this:
The text was updated successfully, but these errors were encountered: