Skip to content

Commit c39aca8

Browse files
committed
fixed regiter_model viya identification
1 parent 047b351 commit c39aca8

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: sasctl
22
Title: The sasctl package enables easy communication between the SAS Viya platform APIs and the R runtime
3-
Version: 0.7.5
3+
Version: 0.7.5.9000
44
Author: Eduardo Hellas
55
Authors@R: c(
66
person(given = "Eduardo",

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# sasctl (development version)
2+
3+
* Fixed `register_model` wrongly identifying which version of Viya it is interacting with, which lead to use wrong upload format.
4+
15
# sasctl 0.7.5
26

37
* 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.

R/model_repository.R

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,9 @@ register_model <- function(session, file, name, project, type,
202202
## not sure which version this change was introduced
203203
if (session$platform$major >= 2024 & session$platform$minor >= 3 ) {
204204

205-
sfile <- list(`_charset_` = "UTF-8", `file-data` = "", files = httr::upload_file(new_file_path))
205+
sfile <- list(`_charset_` = "UTF-8",
206+
`file-data` = "",
207+
files = httr::upload_file(new_file_path)) # name changes from file to files
206208

207209
} else {
208210

@@ -223,15 +225,23 @@ register_model <- function(session, file, name, project, type,
223225
stop("The file is not .zip")
224226
}
225227

226-
if (session$platform$release == "V03" | is.null(session$platform$minor)) {
227-
sfile <- list(file = httr::upload_file(file))
228+
229+
if (session$platform$release == "V04" ) {
230+
231+
sfile <- list(`_charset_` = "UTF-8",
232+
`file-data` = "",
233+
files = httr::upload_file(file)) ## name changes from file to files
234+
228235
}
229236

237+
else if (session$platform$release == "V03") {
238+
sfile <- list(file = httr::upload_file(file))
239+
}
240+
230241
else if (session$platform$major >= 2023 &
231242
session$platform$minor >= 3 ) {
232-
243+
233244
sfile <- httr::upload_file(file)}
234-
235245
else {
236246
### releases older than 2023.3 (and 3.5) requires this format
237247
sfile <- list(file = httr::upload_file(file))

0 commit comments

Comments
 (0)