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

Changed behaviour of port and host assignment #853

Open
Kaschmiri opened this issue Mar 20, 2024 · 1 comment
Open

Changed behaviour of port and host assignment #853

Kaschmiri opened this issue Mar 20, 2024 · 1 comment

Comments

@Kaschmiri
Copy link

Kaschmiri commented Mar 20, 2024

Preface: Sorry for being vague - I have a very limited understanding of this.
I have jupyterlab running on a VM and have been using it with dtale for a while. No jupyterhub involved.
I never managed to get dtale to work "inline", but could reach the instance perfectly fine in a browser tab.
A couple of weeks ago, I foolishly updated my conda environments without creating backups/yml-files to fall back to.
Since then, a lot of the functionality is lost. I have since created a new VM with fresh installations of everything and a cleaner setup of my environments, to no avail.

Firstly, dtale used to use different ports when creating instances from different kernels/notebooks.
For instance, I could start several dtale instances on one kernel/notebook with port 40000, and any instances started on the next kernel/notebook automatically would use port 40001, and so on.
This doesn't work anymore. dtale.instances() or ._main_url will return http://localhost:40000/dtale/main/1 as the first instance on any kernel, and opening that will always show the dtale instance of the first kernel.
Checking the instances in the dtale menu will only list instances started in that kernel.
Any dtale instances opened on other kernels will not show.

If I start instances on a second kernel specifying a different port manually, for e.g. dtale.show(df, port=40001, force=True), I can reach them just fine.

Secondly, the standard behaviour of parameter "host" of dtale.show has changed for me. Before, I could just replace the first part of the url provided by:
d= dtale.show()
d._main_url (or dtale.instances())
Now, I have to specify:
dtale.show(df , host='0.0.0.0', port = 40000, force = True)
Is there a way to revert to the previous behaviour? And is there a way to show dtale instances inline, in this situation?

@Kaschmiri Kaschmiri changed the title dtale Port assignment for dtale instances started in different kernels and network accessibility Mar 20, 2024
@Kaschmiri Kaschmiri changed the title Port assignment for dtale instances started in different kernels and network accessibility Changed behaviour of port and host assignment Mar 20, 2024
@aschonfeld
Copy link
Collaborator

@Kaschmiri so D-Tale will not open a new port for every new piece of data. What is will do is add additional instances to any running port. So say you've loaded one dataframe and it is being displayed on port 40000 with data ID 1. Then you load another dataframe. This will be displayed on port 40000 with data ID 2.

So you'd be able to hit the two pieces of data with these two URLs:

Now if you want to have a different port used everytime then you'll have to specify the port parameter everytime you call dtale.show. This has been the functionality for some time so you must have been working with a very old version.

Here is a pretty good explanation of how data gets routed when you call dtale.show: https://github.com/man-group/dtale?tab=readme-ov-file#startup-behavior

Hope this helps.

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

No branches or pull requests

2 participants