Skip to content
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

The VS code Shiny extension for python never loads the app with large datasets. #62

Open
Oscarhg42 opened this issue Jun 28, 2024 · 5 comments · May be fixed by #65
Open

The VS code Shiny extension for python never loads the app with large datasets. #62

Oscarhg42 opened this issue Jun 28, 2024 · 5 comments · May be fixed by #65

Comments

@Oscarhg42
Copy link

The extension never loads the app correctly when working with large data sets. No error message is given, it just stops after the message INFO: Application startup complete.

I'm loading a pandas dataframe with 520 rows and 20 columns. When I take only 10 rows from the original data set, the app loads fine.

image

@jcheng5
Copy link
Collaborator

jcheng5 commented Jun 28, 2024

Does it take more than 10 seconds for the app to load? If so it’s probably this line, that gives up after 10 seconds:

retryUntilTimeout(10000, () => isPortOpen("127.0.0.1", p))
I think I did it this way because the extension has no way of knowing if the app succeeded or failed to launch, and I didn’t want it to keep waiting on that port forever (imagine that launch window suddenly popping up way down the line).

Maybe it should never time out, but each new attempt to launch should cancel all previous attempts? Or we could simply increase the timeout to something more conservative—10sec is pretty stingy.

@Oscarhg42
Copy link
Author

Oscarhg42 commented Jun 28, 2024

yes, it takes more than 10 seconds to load the dataset and extracting only 10 rows. The thing is that I'm connecting to a databricks server so the connection and loading takes a little bit of time.

One further comment, the app never appears on the right sample browser, it's just stuck after the "INFO" message

@Oscarhg42
Copy link
Author

If I restrict the query to only get 10 rows from source instead of having the entire data set, then the query takes less than 10 seconds approx and the app does load

@gadenbuie
Copy link
Collaborator

gadenbuie commented Jun 28, 2024

Maybe it should never time out, but each new attempt to launch should cancel all previous attempts? Or we could simply increase the timeout to something more conservative—10sec is pretty stingy.

We close existing Shiny terminals with a new launch attempt (a new click on the Play button, not an auto-reload), which I imagine would have the same effect as cancelling previous attempts, right? In which case, upping the timeout is more reasonable.

We could also do something like wait 15 seconds and then ask the user via a dialog box if they want to keep waiting or kill the app.

jcheng5 added a commit that referenced this issue Jun 28, 2024
Previously hardcoded to 10 seconds, now hardcoded to 60 seconds.

“Fixes” #62
@Oscarhg42 Oscarhg42 changed the title The VS code Shiny ectension for python never loads the app with large datasets. The VS code Shiny extension for python never loads the app with large datasets. Jun 28, 2024
@jcheng5
Copy link
Collaborator

jcheng5 commented Jun 28, 2024

@gadenbuie Killing the console would prevent multiple Shiny processes from starting, but I don’t think it will stop openBrowserWhenReady—oooh but maybe that’s the ideal fix. openBrowserWhenReady can be notified or can query whether its owning terminal is still open, and if not, don’t open the browser. What do you think?

@gadenbuie gadenbuie linked a pull request Jul 8, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants