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

R Client 2.0 - Table Ops #4240

Merged
merged 115 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
63e1507
Delete outdated testing files
alexpeters1208 Jun 28, 2023
5478a4b
Merge branch 'deephaven:main' into api-expansion
alexpeters1208 Jun 28, 2023
4e4e6d1
Merge branch 'deephaven:main' into api-expansion
alexpeters1208 Jun 28, 2023
25f7e3b
Merge branch 'deephaven:main' into api-expansion
alexpeters1208 Jun 29, 2023
46ce7f4
Continue api expansion
alexpeters1208 Jun 29, 2023
805c83f
Merge branch 'deephaven:main' into api-expansion
alexpeters1208 Jul 3, 2023
121d3fb
Merge branch 'deephaven:main' into api-expansion
alexpeters1208 Jul 6, 2023
28f87a2
More api stuff
alexpeters1208 Jul 6, 2023
baaef8d
Merge remote-tracking branch 'origin/api-expansion' into api-expansion
alexpeters1208 Jul 6, 2023
e89b8b9
Merge branch 'deephaven:main' into api-expansion
alexpeters1208 Jul 10, 2023
c752a14
Continue API expansion
alexpeters1208 Jul 10, 2023
516b651
Merge remote-tracking branch 'origin/api-expansion' into api-expansion
alexpeters1208 Jul 10, 2023
b2652a5
Merge branch 'deephaven:main' into api-expansion
alexpeters1208 Jul 12, 2023
d5eef1a
Merge branch 'deephaven:main' into api-expansion
alexpeters1208 Jul 13, 2023
acf9aed
Document new methods, start unit testing file. Roxygen not called yet
alexpeters1208 Jul 13, 2023
1c75e40
Merge remote-tracking branch 'origin/api-expansion' into api-expansion
alexpeters1208 Jul 13, 2023
1d32d05
Rearrange methods, change gitignore, generate roxygen
alexpeters1208 Jul 13, 2023
c6d6a27
Merge branch 'deephaven:main' into api-expansion
alexpeters1208 Jul 14, 2023
6d02151
Continue API expansion, do not expose all package functions to user
alexpeters1208 Jul 18, 2023
daf88ec
Merge remote-tracking branch 'origin/api-expansion' into api-expansion
alexpeters1208 Jul 18, 2023
8f4dc93
Merge branch 'deephaven:main' into api-expansion
alexpeters1208 Jul 18, 2023
75ef045
Get rid of experimenting that should not have been committed
alexpeters1208 Jul 18, 2023
86cb58e
Clean up R wrapping, implement agg_by, configure NAMESPACE to only ex…
alexpeters1208 Jul 19, 2023
c131045
Merge branch 'deephaven:main' into api-expansion
alexpeters1208 Jul 19, 2023
e7fcb8c
Refactor type conversion logic, R-level type checking, actually add N…
alexpeters1208 Jul 19, 2023
e0ba56f
Merge branch 'deephaven:main' into api-expansion
alexpeters1208 Jul 19, 2023
ec5339e
Fix helper functions, add Aggregation to NAMESPACE
alexpeters1208 Jul 19, 2023
b7b2d9f
Merge remote-tracking branch 'origin/api-expansion' into api-expansion
alexpeters1208 Jul 19, 2023
3353842
Fix error handling, move unit tests to install automatically
alexpeters1208 Jul 20, 2023
1da5870
Update README to simplify install command in light of automatic test …
alexpeters1208 Jul 20, 2023
55bc030
Add Sorter class to make tableHandle.sort() work, change functions to…
alexpeters1208 Jul 20, 2023
fa1beb9
Merge remote-tracking branch 'origin/api-expansion' into api-expansion
alexpeters1208 Jul 20, 2023
57ed26c
More unit tests
alexpeters1208 Jul 21, 2023
4689f94
Merge branch 'deephaven:main' into api-expansion
alexpeters1208 Jul 21, 2023
bb997a6
Overhaul table ops API for Dplyr feel
alexpeters1208 Jul 24, 2023
07a5c87
More unit tests
alexpeters1208 Jul 25, 2023
1884d5c
Merge branch 'deephaven:main' into api-expansion
alexpeters1208 Jul 25, 2023
8c0eb92
Simplify sorting API, more unit tests
alexpeters1208 Jul 25, 2023
09b2f83
Reorder table operations logically, connect ClientWrapper to newly ex…
alexpeters1208 Jul 25, 2023
d33966c
Fix new table methods, add tests, add conversion functions to be used…
alexpeters1208 Jul 25, 2023
e7bf936
Update generics
alexpeters1208 Jul 25, 2023
a3c8d6e
Reorder agg_by ops, start agg_by testing
alexpeters1208 Jul 26, 2023
1a77370
enable empty _by and agg ops
alexpeters1208 Jul 26, 2023
db78418
agg_by testing
alexpeters1208 Jul 26, 2023
65d9e70
Merge branch 'deephaven:main' into api-expansion
alexpeters1208 Jul 26, 2023
da79c54
Finish agg_by testing
alexpeters1208 Jul 27, 2023
6e2a3d4
Merge remote-tracking branch 'origin/api-expansion' into api-expansion
alexpeters1208 Jul 27, 2023
d131aa7
Add table ops documentation, not hooked into R yet
alexpeters1208 Jul 27, 2023
36b757b
Fix unit tests after renames
alexpeters1208 Jul 27, 2023
3f916df
More unit tests
alexpeters1208 Jul 27, 2023
3417911
Merge branch 'deephaven:main' into api-expansion
alexpeters1208 Jul 27, 2023
0b5ec03
Even more unit tests
alexpeters1208 Jul 27, 2023
0a33c87
Merge remote-tracking branch 'origin/api-expansion' into api-expansion
alexpeters1208 Jul 27, 2023
f022001
Naming consistency in table operations
alexpeters1208 Jul 27, 2023
b158086
Group_by and ungroup tests
alexpeters1208 Jul 27, 2023
638486b
empty_table and time_table tests
alexpeters1208 Jul 28, 2023
d377f82
Join unit tests
alexpeters1208 Jul 28, 2023
ea1fb3b
Add close method
alexpeters1208 Jul 28, 2023
3725496
Merge branch 'deephaven:main' into api-expansion
alexpeters1208 Jul 28, 2023
7e70094
Apply Tidyverse style guide
alexpeters1208 Jul 28, 2023
f89e9f7
Merge remote-tracking branch 'origin/api-expansion' into api-expansion
alexpeters1208 Jul 28, 2023
f781006
Fix rbind implementation
alexpeters1208 Jul 31, 2023
008ac44
Update DESCRIPTION w/ version
alexpeters1208 Jul 31, 2023
4b1e7f3
Merge branch 'main' into api-expansion
alexpeters1208 Jul 31, 2023
ea63467
Merge remote-tracking branch 'origin/main' into api-expansion with me…
alexpeters1208 Jul 31, 2023
19008f4
Fix problems from merge conflict
alexpeters1208 Jul 31, 2023
d29e6bb
Refactor helper functions
alexpeters1208 Aug 2, 2023
546662f
Correction to helper function refactor
alexpeters1208 Aug 2, 2023
cd41a82
Merge branch 'deephaven:main' into api-expansion
alexpeters1208 Aug 2, 2023
3dfb4f5
Add new clientOptionsWrapper in S4. Does not support piping
alexpeters1208 Aug 2, 2023
3b0d89d
More rewrite
alexpeters1208 Aug 3, 2023
8033299
Working unit tests, refactor complete
alexpeters1208 Aug 4, 2023
5203a1a
Apply code review comments
alexpeters1208 Aug 5, 2023
4f09a71
Implement merge
alexpeters1208 Aug 7, 2023
826aaa5
Code review change
alexpeters1208 Aug 7, 2023
e2dde0c
Cpp formatting
alexpeters1208 Aug 7, 2023
433e787
Test base pipe
alexpeters1208 Aug 8, 2023
e064c8a
Merge pull request #5 from alexpeters1208/s4-rewrite
alexpeters1208 Aug 8, 2023
094abe3
Merge branch 'deephaven:main' into api-expansion
alexpeters1208 Aug 8, 2023
6e06ea9
Code review suggestions
alexpeters1208 Aug 8, 2023
d42b76f
Refactor import_table to as_dh_table with generics
alexpeters1208 Aug 9, 2023
e616c51
Merge pull request #6 from alexpeters1208/s4-rewrite
alexpeters1208 Aug 9, 2023
06d7bec
Merge branch 'deephaven:main' into api-expansion
alexpeters1208 Aug 9, 2023
78bbe24
Applying more code review
alexpeters1208 Aug 9, 2023
a7bef48
Applying even more code review
alexpeters1208 Aug 9, 2023
c5bd9d6
Merge branch 'deephaven:main' into s4-rewrite
alexpeters1208 Aug 9, 2023
90c2839
Merge branch 'deephaven:main' into api-expansion
alexpeters1208 Aug 9, 2023
95d4ad4
Merge pull request #7 from alexpeters1208/s4-rewrite
alexpeters1208 Aug 9, 2023
45eab42
Update cpp to conform to new styleguide, need to uncomment pct when c…
alexpeters1208 Aug 9, 2023
b41a35d
Merge branch 'main' into api-expansion
alexpeters1208 Aug 9, 2023
4fe135f
Merge branch 'deephaven:main' into api-expansion
alexpeters1208 Aug 9, 2023
74e5e48
Merge branch 'deephaven:main' into api-expansion
alexpeters1208 Aug 11, 2023
7f5ade2
Uncomment pct, all tests pass
alexpeters1208 Aug 11, 2023
f10d0f3
Merge remote-tracking branch 'origin/api-expansion' into api-expansion
alexpeters1208 Aug 11, 2023
37c301d
Refactor auth API to conform to Python
alexpeters1208 Aug 11, 2023
ed616af
Support multiple int/string options and extra headers
alexpeters1208 Aug 11, 2023
f7797fb
Code review to helper functions
alexpeters1208 Aug 11, 2023
8282d38
Rename connect to dhConnect
alexpeters1208 Aug 11, 2023
1214955
Update NAMESPACE, add warnings, apply styleguide
alexpeters1208 Aug 11, 2023
14a9b11
Enable size 0 empty_table
alexpeters1208 Aug 11, 2023
9aa73fe
Assert options inputs
alexpeters1208 Aug 11, 2023
ebde48d
Merge branch 'deephaven:main' into api-expansion
alexpeters1208 Aug 14, 2023
45bbe5d
Starting client_wrapper docs
alexpeters1208 Aug 14, 2023
38b3496
Support ncol() and dim()
alexpeters1208 Aug 14, 2023
3bdb485
Merge remote-tracking branch 'origin/api-expansion' into api-expansion
alexpeters1208 Aug 14, 2023
1a0df88
Get rid of mistakenly committed docs, add list type verification in m…
alexpeters1208 Aug 14, 2023
ded6524
Code review suggestions
alexpeters1208 Aug 14, 2023
a7ea30d
Verified that exact_join is an analog of left_join
alexpeters1208 Aug 14, 2023
7b0cfb3
Expand sort API, constrain merge args, add username and password to d…
alexpeters1208 Aug 14, 2023
d4e7686
Apply code review
alexpeters1208 Aug 15, 2023
79fb2a4
Kill merge, make merge_tables
alexpeters1208 Aug 15, 2023
e8eb704
Update version
alexpeters1208 Aug 15, 2023
c782b60
Change to abs_sort
alexpeters1208 Aug 15, 2023
f88237c
Support merge_tables(NULL)
alexpeters1208 Aug 15, 2023
794ef84
Change push_to_table to import_table
alexpeters1208 Aug 15, 2023
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
15 changes: 11 additions & 4 deletions R/rdeephaven/R/client_wrapper.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ setMethod(
signature = c(target = "character"),
function(target,
auth_type = "anonymous",
chipkent marked this conversation as resolved.
Show resolved Hide resolved
username = "",
password = "",
auth_token = "",
session_type = "python",
use_tls = FALSE,
Expand All @@ -40,11 +42,12 @@ setMethod(
if (auth_type == "anonymous") {
options$set_default_authentication()
} else if (auth_type == "basic") {
if (auth_token != "") {
verify_string("auth_token", auth_token, TRUE)
options$set_basic_authentication(auth_token)
if ((username != "") && (password != "")) {
verify_string("username", username, TRUE)
verify_string("password", password, TRUE)
options$set_basic_authentication(username, password)
alexpeters1208 marked this conversation as resolved.
Show resolved Hide resolved
} else {
stop("Basic authentication was requested, but no 'auth_token' was provided.")
stop("Basic authentication was requested, but at least one of 'username' or 'password' was not provided.")
}
} else {
if (auth_token != "") {
Expand Down Expand Up @@ -102,6 +105,10 @@ setMethod(
if ((auth_token != "") && (auth_type == "anonymous")) {
warning("'auth_token' was set but it will not be used, as 'auth_type' is 'anonymous'.")
}

if (((username != "") || (password != "")) && auth_type != "basic") {
warning("At least one of 'username' and 'password' were set but they will not be used, as 'auth_type' is not 'basic'.")
}
alexpeters1208 marked this conversation as resolved.
Show resolved Hide resolved

if ((tls_root_certs != "") && (use_tls == FALSE)) {
warning("'tls_root_certs' was set but it will not be used, as 'use_tls is FALSE.")
alexpeters1208 marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
172 changes: 94 additions & 78 deletions R/rdeephaven/R/table_ops.R
alexpeters1208 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -19,39 +19,19 @@ base_merge <- function(x, y, ...) {
#' @export
setMethod(
"merge",
signature = c(x = "TableHandle"),
function(x, y = NULL, ...) {
return(base_merge(x, y, c(...)))
}
)

#' @export
setMethod(
"merge",
signature = c(x = "list"),
function(x, y = NULL, ...) {
signature = c(x = "list", y = "missing"),
function(x, y = NULL) {
verify_type("x", x, "TableHandle", "Deephaven TableHandle", FALSE)
alexpeters1208 marked this conversation as resolved.
Show resolved Hide resolved
return(base_merge(x, y, c(...)))
}
)

#' @export
setMethod(
"merge",
signature = c(x = "TableHandle", y = "list"),
function(x, y, ...) {
verify_type("y", y, "TableHandle", "Deephaven TableHandle", FALSE)
return(base_merge(x, y, c(...)))
return(base_merge(x, y))
}
)

#' @export
setMethod(
"merge",
signature = c(x = "list", y = "TableHandle"),
function(x, y, ...) {
verify_type("x", x, "TableHandle", "Deephaven TableHandle", FALSE)
return(base_merge(x, y, c(...)))
signature = c(x = "TableHandle", y = "missing"),
function(x, y = NULL) {
return(base_merge(x, y))
}
)

Expand All @@ -60,58 +40,90 @@ setMethod(
"merge",
signature = c(x = "TableHandle", y = "TableHandle"),
function(x, y, ...) {
if (length(c(...)) != 0) {
verify_type("...", c(...), "TableHandle", "Deephaven TableHandle", FALSE)
}
return(base_merge(x, y, c(...)))
}
)

#' @export
setMethod(
"merge",
signature = c(x = "list", y = "list"),
function(x, y, ...) {
verify_type("x", x, "TableHandle", "Deephaven TableHandle", FALSE)
verify_type("y", y, "TableHandle", "Deephaven TableHandle", FALSE)
return(base_merge(x, y, c(...)))
}
)

#' @export
setMethod(
"merge",
signature = c(x = "NULL", y = "TableHandle"),
function(x, y, ...) {
return(base_merge(x, y, c(...)))
}
)

#' @export
setMethod(
"merge",
signature = c(x = "NULL", y = "list"),
function(x, y, ...) {
verify_type("y", y, "TableHandle", "Deephaven TableHandle", FALSE)
return(base_merge(x, y, c(...)))
}
)

#' @export
setMethod(
"merge",
signature = c(x = "TableHandle", y = "NULL"),
function(x, y, ...) {
return(base_merge(x, y, c(...)))
}
)

#' @export
setMethod(
"merge",
signature = c(x = "list", y = "NULL"),
function(x, y, ...) {
verify_type("x", x, "TableHandle", "Deephaven TableHandle", FALSE)
return(base_merge(x, y, c(...)))
}
)
#' #' @export
alexpeters1208 marked this conversation as resolved.
Show resolved Hide resolved
#' setMethod(
#' "merge",
#' signature = c(x = "TableHandle", y = "list"),
#' function(x, y, ...) {
#' verify_type("y", y, "TableHandle", "Deephaven TableHandle", FALSE)
#' return(base_merge(x, y, c(...)))
#' }
#' )
#'
#' #' @export
#' setMethod(
#' "merge",
#' signature = c(x = "list", y = "TableHandle"),
#' function(x, y, ...) {
#' verify_type("x", x, "TableHandle", "Deephaven TableHandle", FALSE)
#' return(base_merge(x, y, c(...)))
#' }
#' )
#'
#' #' @export
#' setMethod(
#' "merge",
#' signature = c(x = "TableHandle", y = "TableHandle"),
#' function(x, y, ...) {
#' return(base_merge(x, y, c(...)))
#' }
#' )
#'
#' #' @export
#' setMethod(
#' "merge",
#' signature = c(x = "list", y = "list"),
#' function(x, y, ...) {
#' verify_type("x", x, "TableHandle", "Deephaven TableHandle", FALSE)
#' verify_type("y", y, "TableHandle", "Deephaven TableHandle", FALSE)
#' return(base_merge(x, y, c(...)))
#' }
#' )
#'
#' #' @export
#' setMethod(
#' "merge",
#' signature = c(x = "NULL", y = "TableHandle"),
#' function(x, y, ...) {
#' return(base_merge(x, y, c(...)))
#' }
#' )
#'
#' #' @export
#' setMethod(
#' "merge",
#' signature = c(x = "NULL", y = "list"),
#' function(x, y, ...) {
#' verify_type("y", y, "TableHandle", "Deephaven TableHandle", FALSE)
#' return(base_merge(x, y, c(...)))
#' }
#' )
#'
#' #' @export
#' setMethod(
#' "merge",
#' signature = c(x = "TableHandle", y = "NULL"),
#' function(x, y, ...) {
#' return(base_merge(x, y, c(...)))
#' }
#' )
#'
#' #' @export
#' setMethod(
#' "merge",
#' signature = c(x = "list", y = "NULL"),
#' function(x, y, ...) {
#' verify_type("x", x, "TableHandle", "Deephaven TableHandle", FALSE)
#' return(base_merge(x, y, c(...)))
#' }
#' )

alexpeters1208 marked this conversation as resolved.
Show resolved Hide resolved
setGeneric(
"select",
Expand Down Expand Up @@ -622,7 +634,7 @@ setMethod(
#' @export
setGeneric(
"sort",
function(table_handle, by = character(), descending = FALSE, ...) {
function(table_handle, by = character(), descending = FALSE, abs_col = FALSE, ...) {
alexpeters1208 marked this conversation as resolved.
Show resolved Hide resolved
standardGeneric("sort")
},
signature = c("table_handle", "by", "descending")
Expand All @@ -632,12 +644,16 @@ setGeneric(
setMethod(
"sort",
signature = c(table_handle = "TableHandle"),
function(table_handle, by, descending = FALSE) {
function(table_handle, by, descending = FALSE, abs_col = FALSE) {
alexpeters1208 marked this conversation as resolved.
Show resolved Hide resolved
verify_string("by", by, FALSE)
verify_bool("descending", descending, FALSE)
verify_bool("abs_col", abs_col, FALSE)
if ((length(descending) > 1) && length(descending) != length(by)) {
stop(paste0("'descending' must be the same length as 'by' if more than one entry is supplied. Got 'by' with length ", length(by), " and 'descending' with length", length(descending), "."))
stop(paste0("'descending' must be the same length as 'by' if more than one entry is supplied. Got 'by' with length ", length(by), " and 'descending' with length ", length(descending), "."))
}
if ((length(abs_col) > 1) && length(abs_col) != length(by)) {
stop(paste0("'abs_col' must be the same length as 'by' if more than one entry is supplied. Got 'by' with length ", length(by), " and 'abs_col' with length ", length(abs_col), "."))
}
return(new("TableHandle", .internal_rcpp_object = table_handle@.internal_rcpp_object$sort(by, descending)))
return(new("TableHandle", .internal_rcpp_object = table_handle@.internal_rcpp_object$sort(by, descending, abs_col)))
}
)
4 changes: 2 additions & 2 deletions R/rdeephaven/inst/tests/testthat/test_client_wrapper.R
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ test_that("dhConnect fails nicely with bad inputs", {

expect_error(
dhConnect(target = "localhost:10000", auth_type = "basic"),
"Basic authentication was requested, but no 'auth_token' was provided."
"Basic authentication was requested, but at least one of 'username' or 'password' was not provided."
)
expect_error(
dhConnect(target = "localhost:10000", auth_type = "custom"),
Expand All @@ -198,7 +198,7 @@ test_that("dhConnect fails nicely with bad inputs", {
)
expect_error(
dhConnect(target = "localhost:10000", auth_type = "basic", auth_token = 1234),
"'auth_token' must be a single string. Got an object of class numeric."
"Basic authentication was requested, but at least one of 'username' or 'password' was not provided."
)
expect_error(
dhConnect(target = "localhost:10000", session_type = "blahblah"),
Expand Down
36 changes: 5 additions & 31 deletions R/rdeephaven/inst/tests/testthat/test_table_ops.R
alexpeters1208 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -72,39 +72,13 @@ test_that("merge behaves as expected", {
new_th3 <- merge(data$th5, data$th6, data$th6, data$th5)
expect_equal(as.data.frame(new_th3), new_df3)

new_th4 <- merge(data$th5, NULL)
expect_equal(as.data.frame(new_th4), new_df1)
new_th4 <- merge(c(data$th5, data$th6))
expect_equal(as.data.frame(new_th4), new_df2)

new_th5 <- merge(NULL, data$th5)
expect_equal(as.data.frame(new_th5), new_df1)

new_th6 <- merge(c(data$th5, data$th6))
expect_equal(as.data.frame(new_th6), new_df2)

new_th7 <- merge(NULL, c(data$th5, data$th6))
expect_equal(as.data.frame(new_th7), new_df2)

new_th8 <- merge(c(data$th5, data$th6), NULL)
expect_equal(as.data.frame(new_th8), new_df2)

new_th9 <- merge(data$th5, c(data$th6, data$th6, data$th5))
expect_equal(as.data.frame(new_th9), new_df3)

new_th10 <- merge(c(data$th5, data$th6, data$th6), data$th5)
expect_equal(as.data.frame(new_th10), new_df3)

new_th11 <- merge(c(data$th5, data$th6), c(data$th6, data$th5))
expect_equal(as.data.frame(new_th11), new_df3)

new_th12 <- merge(c(data$th5, data$th6, data$th6, data$th5))
expect_equal(as.data.frame(new_th12), new_df3)

new_th13 <- merge(data$th5, c(data$th6, NULL))
expect_equal(as.data.frame(new_th13), new_df2)

new_th14 <- merge(c(NULL, data$th5), data$th6)
expect_equal(as.data.frame(new_th14), new_df2)
new_th5 <- merge(c(data$th5, data$th6, NULL, data$th6, data$th5))
expect_equal(as.data.frame(new_th5), new_df3)

close(data$client)
})

test_that("select behaves as expected", {
Expand Down
33 changes: 13 additions & 20 deletions R/rdeephaven/src/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,29 +241,23 @@ class TableHandleWrapper {
return new TableHandleWrapper(internal_tbl_hdl.Merge(converted_sources));
};

TableHandleWrapper* Sort(std::vector<std::string> columnSpecs, std::vector<bool> descending) {
TableHandleWrapper* Sort(std::vector<std::string> columnSpecs, std::vector<bool> descending, std::vector<bool> absCol) {
alexpeters1208 marked this conversation as resolved.
Show resolved Hide resolved
std::vector<deephaven::client::SortPair> sort_pairs;
sort_pairs.reserve(columnSpecs.size());

if (descending.size() == 1) {
if (!descending[0]) {
for(int i = 0; i < columnSpecs.size(); i++) {
sort_pairs.push_back(deephaven::client::SortPair::Ascending(columnSpecs[i], false));
}
} else {
for(int i = 0; i < columnSpecs.size(); i++) {
sort_pairs.push_back(deephaven::client::SortPair::Descending(columnSpecs[i], false));
}
}
descending = std::vector<bool>(columnSpecs.size(), descending[0]);
}

else {
for(int i = 0; i < columnSpecs.size(); i++) {
if (!descending[i]) {
sort_pairs.push_back(deephaven::client::SortPair::Ascending(columnSpecs[i], false));
} else {
sort_pairs.push_back(deephaven::client::SortPair::Descending(columnSpecs[i], false));
}
if (absCol.size() == 1) {
absCol = std::vector<bool>(columnSpecs.size(), absCol[0]);
}

for(int i = 0; i < columnSpecs.size(); i++) {
if (!descending[i]) {
sort_pairs.push_back(deephaven::client::SortPair::Ascending(columnSpecs[i], absCol[i]));
} else {
sort_pairs.push_back(deephaven::client::SortPair::Descending(columnSpecs[i], absCol[i]));
}
}

Expand Down Expand Up @@ -335,9 +329,8 @@ class ClientOptionsWrapper {
internal_options->SetDefaultAuthentication();
}

void SetBasicAuthentication(const std::string &authentication_token) {
const std::string authentication_token_base64 = Base64Encode(authentication_token);
internal_options->SetCustomAuthentication("Basic", authentication_token_base64);
void SetBasicAuthentication(const std::string &username, const std::string &password) {
internal_options->SetBasicAuthentication(username, password);
alexpeters1208 marked this conversation as resolved.
Show resolved Hide resolved
}

void SetCustomAuthentication(const std::string &authentication_type, const std::string &authentication_token) {
Expand Down
Loading