Skip to content

Commit

Permalink
Minor bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pinduzera committed Sep 23, 2024
1 parent 82358ac commit 226cbc1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# sasctl (development version)

* Added `scr_batch` argument to `format_data_json`, allowing to have all data in a single json payload for Viya 2024.7 SCR batch scoring feature.
* Fixed some issues related to the PMML payload when uploading models to SAS Model Manager
* Fixed `openBrowser` using a function instead of the argument.

# sasctl 0.7.4

Expand Down
2 changes: 1 addition & 1 deletion R/core.R
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ session <- function(hostname, username = NULL, password = NULL,

message(paste0("If a browser don't open automatically, use the following url: ", url))

if (interactive() && openBrowser()) {
if (interactive() && openBrowser) {
utils::browseURL(url)
} else {
warning("Authentication code method shouldn't be used outside an interactive session.")
Expand Down
17 changes: 14 additions & 3 deletions R/model_repository.R
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,22 @@ register_model <- function(session, file, name, project, type,
sasctl::convert_to_pmml42(file_in = file,
file_out = new_file_path)

sfile <- httr::upload_file(new_file_path)
file = new_file_path

}
}

## not sure which version this change was introduced
if (session$platform$major >= 2024 & session$platform$minor >= 3 ) {

sfile <- list(`_charset_` = "UTF-8", `file-data` = "", files = httr::upload_file(new_file_path))

} else {

sfile <- httr::upload_file(file)

}

}

### ZIP file treatment
Expand Down Expand Up @@ -254,13 +264,14 @@ register_model <- function(session, file, name, project, type,
if (uuid::UUIDvalidate(project)) {
stop("Project with current uuid doesn't exist. uuid string is not a valid name for a new project")
}


## TODO add check of input_cars and output_vars

project <- create_project(session,
name = project,
description = project_description,
model_function = model_function,
additional_parameters = additional_project_parameters,
additional_parameters = additional_project_parameters,
...)

message(paste0("The project '", project$name, "' has been successfully created"))
Expand Down

0 comments on commit 226cbc1

Please sign in to comment.