Skip to content

Commit

Permalink
R client: remove call to "Observe" in the C++ client, add missing dep…
Browse files Browse the repository at this point in the history
…endencies (deephaven#4600)

* R Client: remove call to Observe, add dependencies to README

* move test package install to a different part of the README
  • Loading branch information
kosak authored Oct 5, 2023
1 parent 87ee5ec commit a3eb75b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 6 additions & 1 deletion R/rdeephaven/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,12 @@ this means that the C++ compiler does not know where to find the relevant header

## Running the unit tests

The Deephaven R client utilizes R's `testthat` package to perform unit tests. In order to run these unit tests, install `testthat` via `install.packages("testthat")`. Then, from an R session with `rdeephaven` installed, run the unit tests:
The Deephaven R client utilizes R's `testthat` package to perform unit tests. In order to run these unit tests, install `testthat` and the other dependent packages:
```r
install.packages(c('testthat', 'lubridate', 'zoo'))
```

Then, from an R session with `rdeephaven` installed, run the unit tests:
```r
library(testthat)
test_package("rdeephaven")
Expand Down
5 changes: 2 additions & 3 deletions R/rdeephaven/src/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -673,10 +673,9 @@ class ClientWrapper {
* @return Boolean indicating whether table_name exists on the server or not.
*/
bool CheckForTable(std::string table_name) {
// we have to first fetchTable to check existence, fetchTable does not fail on its own, but .observe() will fail if table doesn't exist
deephaven::client::TableHandle table_handle = internal_tbl_hdl_mngr.FetchTable(table_name);
// we have to fetchTable to check existence.
try {
table_handle.Observe();
deephaven::client::TableHandle table_handle = internal_tbl_hdl_mngr.FetchTable(table_name);
} catch(...) {
return false;
}
Expand Down

0 comments on commit a3eb75b

Please sign in to comment.