Assigne / manipulate `grok.shell.project`

Is there a way to control or manipulate the grok.shell.project value programatically?

Context: Our use case is to either open an existing project or create a new project and work with this. On open an existing project, new opened project gets assigned to grok.shell.project. However when we create a new project we cannot assign this to grok.shell.project (this variable always points to “Scratchpad” project)?

Right now no.
It was designed as a read-only property, and “scratchpad-based” logic is based on UI behavior.
I suppose, you are trying to create a new project and set it as default or open?
I think we can support case when you create project on client-side, and open it, is it the case?

1 Like

Yes exactly that’s my main use case. However as long as the Scratchpad project is assigned to grok.shell.project the new project is not assigned to this var (tried already to call newProject.open() as workaround).

Both should work. newProject.open() and .project = newProject, it’s a bug

BTW, what do you expect as an active project? Where do you use it? If you have newProject and can open it, it should be enough

So basically I was expecting to grok.shell.project to be the reference to the latest opened project. We need this as we create new project on the fly and use it to save the dataframes (and later view layouts) to it!?

As a workaround for now, we keep track of the project reference by our self but that should be only a workaround until this gets fixed!

1 Like

Fixed in 1.12.0,
now you can open newly created project, and grok.shell.project indicate latest project.

Also, issue with Project’s list in children list is fixed.