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

Fix an issue in R client wrapping of extra headers. #4357

Merged
merged 2 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions R/rdeephaven/R/client_wrapper.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ setMethod(

# if tls is requested, set it and set the root_certs if provided
if (use_tls == TRUE) {
options$set_use_tls()
options$set_use_tls(TRUE)
if (tls_root_certs != "") {
verify_string("tls_root_certs", tls_root_certs, TRUE)
options$set_tls_root_certs(tls_root_certs)
Expand All @@ -82,7 +82,7 @@ setMethod(

# set extra header options if they are provided
if (length(int_options) != 0) {
verify_list("int_options", int_options, TRUE)
verify_list("int_options", int_options)
for (key in names(int_options)) {
verify_string("key", key, TRUE)
verify_int("value", int_options[[key]], TRUE)
Expand All @@ -91,7 +91,7 @@ setMethod(
}

if (length(string_options) != 0) {
verify_list("string_options", string_options, TRUE)
verify_list("string_options", string_options)
for (key in names(string_options)) {
verify_string("key", key, TRUE)
verify_string("value", string_options[[key]], TRUE)
Expand All @@ -100,11 +100,11 @@ setMethod(
}

if (length(extra_headers) != 0) {
verify_list("extra_headers", extra_headers, TRUE)
verify_list("extra_headers", extra_headers)
for (key in names(extra_headers)) {
verify_string("key", key, TRUE)
verify_string("value", extra_headers[[key]], TRUE)
options$add_extra_headers(key, extra_headers[[key]])
options$add_extra_header(key, extra_headers[[key]])
}
}

Expand Down
6 changes: 4 additions & 2 deletions R/rdeephaven/R/helper_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ verify_numeric <- function(arg_name, candidate, is_scalar) {
verify_type(arg_name, candidate, "numeric", "numeric", is_scalar)
}

verify_list <- function(arg_name, candidate, is_scalar) {
verify_type(arg_name, candidate, "list", "list", is_scalar)
verify_list <- function(arg_name, candidate) {
if (first_class(candidate) != "list") {
stop(paste0("'", arg_name, "' must be a list."))
}
}

verify_in_unit_interval <- function(arg_name, candidate, is_scalar) {
Expand Down
Loading