-
Notifications
You must be signed in to change notification settings - Fork 8
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
Connection pane improvements #29
Conversation
…iew from the UC 2. changed get_tables() in connection-pane.R to receive dataframe containing table name and type extracted from UC 3. changed open_workspace() in connection-pane.R to use db_wsid() for workspace name
Added filtering function for clusters and sub-nodes for job and personal clusters. Dropped the data container file
…dman/brickster into connection-pane-improvements
@@ -2,6 +2,11 @@ | |||
# - can only return so many objects at once, how to paginate via UI? | |||
# - impacts experiments, model registry, etc. | |||
|
|||
# adding new environment to hold the data. | |||
brixter.env <- new.env() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added brixter.env to hold the data which can then be filtered without API calls
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #29 +/- ##
==========================================
- Coverage 11.74% 11.59% -0.16%
==========================================
Files 22 22
Lines 2682 2717 +35
==========================================
Hits 315 315
- Misses 2367 2402 +35
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
list( | ||
name = as.character(glue::glue("[{x$state}] {x$cluster_name} ({x$cluster_id})")), | ||
type = "cluster" | ||
) | ||
}) | ||
} | ||
|
||
|
||
get_clusters_2 <- function(host, token) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function loads clusters into the brixter.env and just shows two leaves underneath. Those leaves are expanded on consecutive click when clusters are filtered from the brixter.env$cluster
|
||
} | ||
|
||
filter_clusters <-function(lFilter){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filter selected branch of clusters
...) { | ||
|
||
if (!is.null(skodman_test)) { | ||
#browser() | ||
if(is.null(brixter.env$clusters)){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checks if clusters are already loaded into the brixter.env
@@ -841,12 +916,14 @@ preview_object <- function(host, token, rowLimit, | |||
#' open_workspace(host = db_host(), token = db_token, name = "MyWorkspace") | |||
#' } | |||
#' @importFrom glue glue | |||
open_workspace <- function(host = db_host(), token = db_token(), name = NULL) { | |||
open_workspace <- function(host = db_host(), token = db_token(), name = db_wsid()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes the name for Connections tab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be open to making db_host() the default for name
- that seems very sensible!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Id's tend to be tricky for people to remember which is which
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, although the db_host() is equally confusing for me. Maybe introducing workspace alias (which would be up to user to define in .databrickscfg) is the way to go. There user could define test-ws, prod-ws etc, something that is readable.
@@ -925,9 +1005,13 @@ close_workspace <- function(host = db_host()) { | |||
if (!is.null(observer)) { | |||
observer$connectionClosed(type = "workspace", host = host) | |||
} | |||
|
|||
# clean up .rs.WorkingDataEnv | |||
rm(list=ls(envir =brixter.env),envir=brixter.env) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cleans up brixter.env variables
)) | ||
) | ||
} | ||
|
||
|
||
# clusters = list(contains = list( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll remove this
Will close this for now and re-visit connection pane ideas once I've implemented some changes to it's core behaviour that are required. |
Created brixter.env environment to hold the data and reduce the number of API calls (if possible). I wanted to separate clusters by their purpose so I've added skodman_test element to the connections tree list with two leafs under neath: Personal and Job (left Pools from the list as we are not using those so i can't test, should probably be be added). Have a look at the brixter.env environment, get_clusters_2 and filter_clusters functions below. Was wondering if this is something you might want to consider and if so i can cleanup the code.
I've also made some changes to fix the name of the workspace in the Connections tab.