Skip to content

316 use etnservice as a dependency and drop sql helpers #317

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

Draft
wants to merge 66 commits into
base: v2.3.1
Choose a base branch
from

Conversation

PietrH
Copy link
Member

@PietrH PietrH commented Sep 27, 2024

  • update from v2.3
  • add patch note to NEWS
  • remove sql helpers
  • check if experimental code is replaced by more general helper

When I first started working on this, I didn't implement the changes to the helper immediately, but rather experimented in a single function: b03e88f, later on I moved this change to the forward_to_api() helper, meaning that a lot of lines can be removed. All this code still exists of course, just in etnservice instead of here as a duplicate.

From this PR onward, the API and local database connection should always return exactly the same result, any differences resulting from unintended type parsing should be considered a bug.

It seems not all the changes from v2.3 are present in this branch, namely the vignettes.

API - SQL mismatch

mismatches for:

  • get_cpod_projects
  • list_animal_project_codes
  • list_acoustic_project_codes
  • get_animals
  • list_receiver_ids
  • get_tags
  • get_animal_projects
  • list_scientific_names
  • get_acoustic_projects

get_cpod_projects

[1] "get_cpod_projects"
Error: `api_result` (`actual`) not identical to `sql_result` (`expected`).

`actual$moratorium` is a character vector ('0', '1', '1', '1', '0', ...)
`expected$moratorium` is a logical vector (FALSE, TRUE, TRUE, TRUE, FALSE, ...)

list_animal_ids: missing animal ID

56314 known id is missing from both the API and SQL result, I've sent an email to Claudia

Merge with v2.2.0

I made a mistake, I should have updated v2.3.1 from main instead.

  • resolve merge conflict
  • Lintr & Style pass
  • Check for connection usage for sql tests
  • pass tests without db access (did any break in the merge?)
    • depth_in_meters column is missing from get_acoustic_detections()
    Failure (test-get_acoustic_detections.R:59:3): get_acoustic_detections() returns the expected columns
    names(df) (`actual`) not identical to `expected_col_names` (`expected`).
    
         actual             | expected               
    [10] "station_name"     | "station_name"     [10]
    [11] "deploy_latitude"  | "deploy_latitude"  [11]
    [12] "deploy_longitude" | "deploy_longitude" [12]
                            - "depth_in_meters"  [13]
    [13] "sensor_value"     | "sensor_value"     [14]
    [14] "sensor_unit"      | "sensor_unit"      [15]
    [15] "sensor2_value"    | "sensor2_value"    [16]
    It's possible this change was made to etn, but not to etnservice, and is now been accidentally reverted.
  • pass tests on rstudio server
  • pass R CMD CHECK
  • consider checking code coverage
  • check if all sql test are skipped when there is no local connection to etn
  • update version number in description + CITATION.cff
  • rebuild website

Review comments

Update v2.3.1 from main

  • do it
  • resolve merge conflicts with v2.3.1

@PietrH PietrH added this to the v2.3.1 milestone Oct 4, 2024
@PietrH PietrH force-pushed the 316-use-etnservice-as-a-dependency-and-drop-_sql-helpers branch from 0e15606 to ad753e0 Compare October 4, 2024 09:55
PietrH added 3 commits October 4, 2024 11:56
…s' of github.com:inbo/etn into 316-use-etnservice-as-a-dependency-and-drop-_sql-helpers
@PietrH PietrH changed the base branch from v2.3 to v2.3.1 October 18, 2024 07:09
@PietrH PietrH linked an issue Oct 18, 2024 that may be closed by this pull request
@PietrH PietrH added the API label Oct 18, 2024
@PietrH
Copy link
Member Author

PietrH commented Oct 18, 2024

Should we have a seperate test file that checks if the API and SQL return the same results? Or should these tests be included in the function test files?

I'm quite tempted to use:

for(function_to_test in getNamespaceExports("etnservice")) {
  test_that(paste(
    function_to_test,
    "returns same result over api as over local db connection"
  ),
  {
    skip_if_offline()
    
    api_result <- do.call(function_to_test, list(api = TRUE))
    sql_result <- do.call(function_to_test, list(api = FALSE))
    expect_identical(api_result, sql_result, label = function_to_test)
  })
}

But not all functions run without arguments (returned objects too large?)

@peterdesmet
Copy link
Member

Maybe this is a good use case for a custom expectation.

For example, you could create a expect_call_agnostic(), with one argument: a function call. The helper could grab the function call (and its arguments), run it locally and over API and expect the result to be the same.

It could then be called as part of a regular test-function.R file:

testthat("get_animals() returns same result locally and via API", {
  expect_call_agnostic(get_animals(animal_id = "5"))
})

@PietrH
Copy link
Member Author

PietrH commented Oct 18, 2024

That sounds great! Do you think we should include that here, or rather as a separate PR?

@PietrH
Copy link
Member Author

PietrH commented Oct 18, 2024

9 functions currently fail to return the same result over the api as over a local connection.

@peterdesmet
Copy link
Member

That sounds great! Do you think we should include that here, or rather as a separate PR?

I'll leave that to you

@PietrH
Copy link
Member Author

PietrH commented Apr 23, 2025

Lots of test failures on the RStudio Server:

==> devtools::test()

Loading etn
Testing etn| F W  S  OK | Context|         16 | api_helpers [2.1s]                                                    
✔ |         10 | check_value|      2   2 | connect_to_etn| 1 2  1   5 | download_acoustic_dataset                                             Downloading data to directory `/tmp/Rtmp0BNJm8`:
* (1/6): downloading animals.csv
* (2/6): downloading tags.csv
* (3/6): downloading detections.csv
* (4/6): downloading deployments.csv
* (5/6): downloading receivers.csv
* (6/6): adding datapackage.json as file metadata

Summary statistics for dataset `2014_demer`:
* number of animals:           16
* number of tags:              16
* number of detections:        236918
* number of deployments:       1152
* number of receivers:         249
* first date of detection:     2014-04-18
* last date of detection:      2018-09-15
* included scientific names:   Petromyzon marinus, Rutilus rutilus, Silurus glanis, Squalius cephalus
* included acoustic projects:  V2LCHASES, albert, demer, dijle, zeeschelde| 4 2  1  21 | download_acoustic_dataset [92.5s]                                     
───────────────────────────────────────────────────────────────────────────────────────
Warning (test-download_acoustic_dataset.R:27:3): download_acoustic_dataset() creates the expected files
Adding new snapshot for variant 'api':
Code
  download_acoustic_dataset(api = TRUE, animal_project_code = "2014_demer",
    directory = download_dir)
Message
  Downloading data to directory :
  * (1/6): downloading animals.csv
  * (2/6): downloading tags.csv
  * (3/6): downloading detections.csv
  * (4/6): downloading deployments.csv
  * (5/6): downloading receivers.csv
  * (6/6): adding datapackage.json as file metadata
  
  Summary statistics for dataset `2014_demer`:
  * number of animals:           16
  * number of tags:              16
  * number of detections:        236918
  * number of deployments:       1152
  * number of receivers:         249
  * first date of detection:     2014-04-18
  * last date of detection:      2018-09-15
  * included scientific names:   Petromyzon marinus, Rutilus rutilus, Silurus glanis, Squalius cephalus
  * included acoustic projects:  V2LCHASES, albert, demer, dijle, zeeschelde
  

Error (test-download_acoustic_dataset.R:52:3): download_acoustic_dataset() creates the expected messages and files using local db
Error in `files_to_create %in% list.files(tempdir())`: object 'files_to_create' not found
Backtrace:1. ├─testthat::expect_true(all(files_to_create %in% list.files(tempdir()))) at test-download_acoustic_dataset.R:52:3
 2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
 3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
 4. └─files_to_create %in% list.files(tempdir())

Warning (test-download_acoustic_dataset.R:63:3): download_acoustic_dataset() returns message and summary stats
Adding new snapshot:
Code
  cat(download_acoustic_dataset(animal_project_code = "2014_demer"))
Message
  Downloading data to directory `2014_demer`:
  * (1/6): downloading animals.csv
  * (2/6): downloading tags.csv
  * (3/6): downloading detections.csv
  * (4/6): downloading deployments.csv
  * (5/6): downloading receivers.csv
  * (6/6): adding datapackage.json as file metadata
  
  Summary statistics for dataset `2014_demer`:
  * number of animals:           16
  * number of tags:              16
  * number of detections:        236918
  * number of deployments:       1152
  * number of receivers:         249
  * first date of detection:     2014-04-18
  * last date of detection:      2018-09-15
  * included scientific names:   Petromyzon marinus, Rutilus rutilus, Silurus glanis, Squalius cephalus
  * included acoustic projects:  V2LCHASES, albert, demer, dijle, zeeschelde
  

Failure (test-download_acoustic_dataset.R:119:3): download_acoustic_dataset() creates a valid Frictionless Data Package
Expected `suppressMessages(frictionless::read_resource(datapackage, "detections"))` to run without any warnings.
i Actually got a <vroom_parse_issue> with text:
  One or more parsing issues, call `problems()` on your data frame for details, e.g.:
    dat <- vroom(...)
    problems(dat)

Failure (test-download_acoustic_dataset.R:144:3): download_acoustic_dataset() returns CSV files with expected columns
fetch_schema_fields(datapackage, "detections") has length 21, not length 20.

Failure (test-download_acoustic_dataset.R:192:3): download_acoustic_dataset() returns CSV files with columns in expected order
sapply(fetch_schema_fields(datapackage, "detections"), function(x) x[["name"]]) (`actual`) not identical to names(...) (`expected`).

     actual             | expected               
[10] "station_name"     | "station_name"     [10]
[11] "deploy_latitude"  | "deploy_latitude"  [11]
[12] "deploy_longitude" | "deploy_longitude" [12]
[13] "depth_in_meters"  -                        
[14] "sensor_value"     | "sensor_value"     [13]
[15] "sensor_unit"      | "sensor_unit"      [14]
[16] "sensor2_value"    | "sensor2_value"    [15]
───────────────────────────────────────────────────────────────────────────────────────
✔ |         70 | get_acoustic_deployments [44.7s]                                      
✖ | 1    4  70 | get_acoustic_detections [106.0s]                                      
───────────────────────────────────────────────────────────────────────────────────────
Failure (test-get_acoustic_detections.R:59:3): get_acoustic_detections() returns the expected columns
names(df) (`actual`) not identical to `expected_col_names` (`expected`).

     actual             | expected               
[10] "station_name"     | "station_name"     [10]
[11] "deploy_latitude"  | "deploy_latitude"  [11]
[12] "deploy_longitude" | "deploy_longitude" [12]
                        - "depth_in_meters"  [13]
[13] "sensor_value"     | "sensor_value"     [14]
[14] "sensor_unit"      | "sensor_unit"      [15]
[15] "sensor2_value"    | "sensor2_value"    [16]
───────────────────────────────────────────────────────────────────────────────────────
✔ |         14 | get_acoustic_projects [14.6s]                                         
✔ |         18 | get_acoustic_receivers [21.5s]                                        
✔ |         14 | get_animal_projects [20.0s]                                           
✔ |         39 | get_animals [57.7s]                                                   
✔ |         14 | get_cpod_projects [17.6s]                                             
✔ |          2 | get_credentials|         36 | get_tags [47.6s]                                                      
✔ |          6 | list_acoustic_project_codes|          6 | list_acoustic_tag_ids| 3        3 | list_animal_ids                                                       
───────────────────────────────────────────────────────────────────────────────────────
Failure (test-list_animal_ids.R:14:3): list_animal_ids() returns same list over api and sql
`result_api` (`actual`) not identical to `result_sql` (`expected`).

  `actual[10566:10573]`: 24245 24246 24247 55431 55433 57292 57293 57294
`expected[10566:10571]`: 24245 24246 24247             57292 57293 57294

        actual | expected                  
[18463] 74212  | 74212    [18461]          
[18464] 74213  | 74213    [18462]          
[18465] 74214  | 74214    [18463]          
[18466] 74220  - 74609    [18464]          
[18467] 74221  - 74616    [18465]          
[18468] 74222  - 76528    [18466]          
[18469] 74223  - 76534    [18467]          
[18470] 74224  - 76967    [18468]          
[18471] 74225  - 76973    [18469]          
[18472] 74226  - 76978    [18470]          
    ... ...      ...      and 4646 more ...

Failure (test-list_animal_ids.R:24:3): list_animal_ids returns at least 5 known values
all(known_ids %in% result_api) is not TRUE

`actual`:   FALSE
`expected`: TRUE 

Failure (test-list_animal_ids.R:25:3): list_animal_ids returns at least 5 known values
all(known_ids %in% result_sql) is not TRUE

`actual`:   FALSE
`expected`: TRUE 
───────────────────────────────────────────────────────────────────────────────────────
✔ |          6 | list_animal_project_codes|         12 | list_cpod_project_codes|          8 | list_deployment_ids|          4 | list_receiver_ids|          4 | list_scientific_names|          4 | list_station_names|          8 | list_tag_serial_numbers|         16 | list_values                                                           4 unique chr_col values
3 unique num_col values|         19 | list_values|          1 | utils [1.4s]                                                          
✖ | 3        9 | write_dwc [45.8s]                                                     
───────────────────────────────────────────────────────────────────────────────────────
Error (test-write_dwc.R:7:3): [SQL] write_dwc() can write csv files to a path
<Rcpp::not_compatible/C++Error/error/condition>
Error: Expecting a single string value: [type=character; extent=0].
Backtrace:1. ├─base::suppressMessages(...) at test-write_dwc.R:7:3
  2. │ └─base::withCallingHandlers(expr, message = function(c) invokeRestart("muffleMessage"))
  3. └─etn::write_dwc(...)
  4.   └─etn:::conduct_parent_to_helpers(api, json = FALSE, ignored_arguments = "directory") at etn/R/write_dwc.R:59:3
  5.     ├─base::do.call(...) at etn/R/conduct_parent_to_helpers.R:47:5
  6.     └─etnservice (local) `<fn>`(...)
  7.       ├─DBI::dbGetQuery(connection, dwc_occurrence_sql) at etnservice/R/write_dwc.R:98:3
  8.       └─DBI::dbGetQuery(connection, dwc_occurrence_sql)
  9.         └─odbc (local) .local(conn, statement, ...)
 10.           ├─DBI::dbSendQuery(...)
 11.           └─odbc::dbSendQuery(...)
 12.             └─odbc (local) .local(conn, statement, ...)
 13.               └─odbc:::OdbcResult(...)
 14.                 └─odbc:::new_result(p = connection@ptr, sql = statement, immediate = immediate)

Error (test-write_dwc.R:20:3): [SQL] write_dwc() can return data as list of tibbles rather than files
<Rcpp::not_compatible/C++Error/error/condition>
Error: Expecting a single string value: [type=character; extent=0].
Backtrace:1. ├─base::suppressMessages(...) at test-write_dwc.R:20:3
  2. │ └─base::withCallingHandlers(expr, message = function(c) invokeRestart("muffleMessage"))
  3. └─etn::write_dwc(...)
  4.   └─etn:::conduct_parent_to_helpers(api, json = FALSE, ignored_arguments = "directory") at etn/R/write_dwc.R:59:3
  5.     ├─base::do.call(...) at etn/R/conduct_parent_to_helpers.R:47:5
  6.     └─etnservice (local) `<fn>`(...)
  7.       ├─DBI::dbGetQuery(connection, dwc_occurrence_sql) at etnservice/R/write_dwc.R:98:3
  8.       └─DBI::dbGetQuery(connection, dwc_occurrence_sql)
  9.         └─odbc (local) .local(conn, statement, ...)
 10.           ├─DBI::dbSendQuery(...)
 11.           └─odbc::dbSendQuery(...)
 12.             └─odbc (local) .local(conn, statement, ...)
 13.               └─odbc:::OdbcResult(...)
 14.                 └─odbc:::new_result(p = connection@ptr, sql = statement, immediate = immediate)

Error (test-write_dwc.R:31:3): [SQL] write_dwc() returns the expected Darwin Core terms as columns
<Rcpp::not_compatible/C++Error/error/condition>
Error: Expecting a single string value: [type=character; extent=0].
Backtrace:1. ├─base::suppressMessages(...) at test-write_dwc.R:31:3
  2. │ └─base::withCallingHandlers(expr, message = function(c) invokeRestart("muffleMessage"))
  3. └─etn::write_dwc(...)
  4.   └─etn:::conduct_parent_to_helpers(api, json = FALSE, ignored_arguments = "directory") at etn/R/write_dwc.R:59:3
  5.     ├─base::do.call(...) at etn/R/conduct_parent_to_helpers.R:47:5
  6.     └─etnservice (local) `<fn>`(...)
  7.       ├─DBI::dbGetQuery(connection, dwc_occurrence_sql) at etnservice/R/write_dwc.R:98:3
  8.       └─DBI::dbGetQuery(connection, dwc_occurrence_sql)
  9.         └─odbc (local) .local(conn, statement, ...)
 10.           ├─DBI::dbSendQuery(...)
 11.           └─odbc::dbSendQuery(...)
 12.             └─odbc (local) .local(conn, statement, ...)
 13.               └─odbc:::OdbcResult(...)
 14.                 └─odbc:::new_result(p = connection@ptr, sql = statement, immediate = immediate)
───────────────────────────────────────────────────────────────────────────────────────
Maximum number of failures exceeded; quitting at end of file.Increase this number with (e.g.) `testthat::set_max_fails(Inf)` 

══ Results ════════════════════════════════════════════════════════════════════════════
Duration: 473.3 s

── Skipped tests (7) ──────────────────────────────────────────────────────────────────
• BUG #278 crashes on big queries like demer and dijle (1):
  test-get_acoustic_detections.R:319:3BUG #319: tests will always fail after first deprecation test (2):
  test-connect_to_etn.R:8:3, test-connect_to_etn.R:15:3Issue #283 detection_id is currently not unique (1):
  test-get_acoustic_detections.R:27:3TODO: https://github.com/inbo/etn/issues/216 (1):
  test-get_acoustic_detections.R:443:3TODO: re-enable after https://github.com/inbo/etn/issues/252 (1):
  test-get_acoustic_detections.R:423:3empty test (1): test-download_acoustic_dataset.R:11:1

── Failed tests ───────────────────────────────────────────────────────────────────────
Error (test-download_acoustic_dataset.R:52:3): download_acoustic_dataset() creates the expected messages and files using local db
Error in `files_to_create %in% list.files(tempdir())`: object 'files_to_create' not found
Backtrace:1. ├─testthat::expect_true(all(files_to_create %in% list.files(tempdir()))) at test-download_acoustic_dataset.R:52:3
 2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
 3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
 4. └─files_to_create %in% list.files(tempdir())

Failure (test-download_acoustic_dataset.R:119:3): download_acoustic_dataset() creates a valid Frictionless Data Package
Expected `suppressMessages(frictionless::read_resource(datapackage, "detections"))` to run without any warnings.
i Actually got a <vroom_parse_issue> with text:
  One or more parsing issues, call `problems()` on your data frame for details, e.g.:
    dat <- vroom(...)
    problems(dat)

Failure (test-download_acoustic_dataset.R:144:3): download_acoustic_dataset() returns CSV files with expected columns
fetch_schema_fields(datapackage, "detections") has length 21, not length 20.

Failure (test-download_acoustic_dataset.R:192:3): download_acoustic_dataset() returns CSV files with columns in expected order
sapply(fetch_schema_fields(datapackage, "detections"), function(x) x[["name"]]) (`actual`) not identical to names(...) (`expected`).

     actual             | expected               
[10] "station_name"     | "station_name"     [10]
[11] "deploy_latitude"  | "deploy_latitude"  [11]
[12] "deploy_longitude" | "deploy_longitude" [12]
[13] "depth_in_meters"  -                        
[14] "sensor_value"     | "sensor_value"     [13]
[15] "sensor_unit"      | "sensor_unit"      [14]
[16] "sensor2_value"    | "sensor2_value"    [15]

Failure (test-get_acoustic_detections.R:59:3): get_acoustic_detections() returns the expected columns
names(df) (`actual`) not identical to `expected_col_names` (`expected`).

     actual             | expected               
[10] "station_name"     | "station_name"     [10]
[11] "deploy_latitude"  | "deploy_latitude"  [11]
[12] "deploy_longitude" | "deploy_longitude" [12]
                        - "depth_in_meters"  [13]
[13] "sensor_value"     | "sensor_value"     [14]
[14] "sensor_unit"      | "sensor_unit"      [15]
[15] "sensor2_value"    | "sensor2_value"    [16]

Failure (test-list_animal_ids.R:14:3): list_animal_ids() returns same list over api and sql
`result_api` (`actual`) not identical to `result_sql` (`expected`).

  `actual[10566:10573]`: 24245 24246 24247 55431 55433 57292 57293 57294
`expected[10566:10571]`: 24245 24246 24247             57292 57293 57294

        actual | expected                  
[18463] 74212  | 74212    [18461]          
[18464] 74213  | 74213    [18462]          
[18465] 74214  | 74214    [18463]          
[18466] 74220  - 74609    [18464]          
[18467] 74221  - 74616    [18465]          
[18468] 74222  - 76528    [18466]          
[18469] 74223  - 76534    [18467]          
[18470] 74224  - 76967    [18468]          
[18471] 74225  - 76973    [18469]          
[18472] 74226  - 76978    [18470]          
    ... ...      ...      and 4646 more ...

Failure (test-list_animal_ids.R:24:3): list_animal_ids returns at least 5 known values
all(known_ids %in% result_api) is not TRUE

`actual`:   FALSE
`expected`: TRUE 

Failure (test-list_animal_ids.R:25:3): list_animal_ids returns at least 5 known values
all(known_ids %in% result_sql) is not TRUE

`actual`:   FALSE
`expected`: TRUE 

Error (test-write_dwc.R:7:3): [SQL] write_dwc() can write csv files to a path
<Rcpp::not_compatible/C++Error/error/condition>
Error: Expecting a single string value: [type=character; extent=0].
Backtrace:1. ├─base::suppressMessages(...) at test-write_dwc.R:7:3
  2. │ └─base::withCallingHandlers(expr, message = function(c) invokeRestart("muffleMessage"))
  3. └─etn::write_dwc(...)
  4.   └─etn:::conduct_parent_to_helpers(api, json = FALSE, ignored_arguments = "directory") at etn/R/write_dwc.R:59:3
  5.     ├─base::do.call(...) at etn/R/conduct_parent_to_helpers.R:47:5
  6.     └─etnservice (local) `<fn>`(...)
  7.       ├─DBI::dbGetQuery(connection, dwc_occurrence_sql) at etnservice/R/write_dwc.R:98:3
  8.       └─DBI::dbGetQuery(connection, dwc_occurrence_sql)
  9.         └─odbc (local) .local(conn, statement, ...)
 10.           ├─DBI::dbSendQuery(...)
 11.           └─odbc::dbSendQuery(...)
 12.             └─odbc (local) .local(conn, statement, ...)
 13.               └─odbc:::OdbcResult(...)
 14.                 └─odbc:::new_result(p = connection@ptr, sql = statement, immediate = immediate)

Error (test-write_dwc.R:20:3): [SQL] write_dwc() can return data as list of tibbles rather than files
<Rcpp::not_compatible/C++Error/error/condition>
Error: Expecting a single string value: [type=character; extent=0].
Backtrace:1. ├─base::suppressMessages(...) at test-write_dwc.R:20:3
  2. │ └─base::withCallingHandlers(expr, message = function(c) invokeRestart("muffleMessage"))
  3. └─etn::write_dwc(...)
  4.   └─etn:::conduct_parent_to_helpers(api, json = FALSE, ignored_arguments = "directory") at etn/R/write_dwc.R:59:3
  5.     ├─base::do.call(...) at etn/R/conduct_parent_to_helpers.R:47:5
  6.     └─etnservice (local) `<fn>`(...)
  7.       ├─DBI::dbGetQuery(connection, dwc_occurrence_sql) at etnservice/R/write_dwc.R:98:3
  8.       └─DBI::dbGetQuery(connection, dwc_occurrence_sql)
  9.         └─odbc (local) .local(conn, statement, ...)
 10.           ├─DBI::dbSendQuery(...)
 11.           └─odbc::dbSendQuery(...)
 12.             └─odbc (local) .local(conn, statement, ...)
 13.               └─odbc:::OdbcResult(...)
 14.                 └─odbc:::new_result(p = connection@ptr, sql = statement, immediate = immediate)

Error (test-write_dwc.R:31:3): [SQL] write_dwc() returns the expected Darwin Core terms as columns
<Rcpp::not_compatible/C++Error/error/condition>
Error: Expecting a single string value: [type=character; extent=0].
Backtrace:1. ├─base::suppressMessages(...) at test-write_dwc.R:31:3
  2. │ └─base::withCallingHandlers(expr, message = function(c) invokeRestart("muffleMessage"))
  3. └─etn::write_dwc(...)
  4.   └─etn:::conduct_parent_to_helpers(api, json = FALSE, ignored_arguments = "directory") at etn/R/write_dwc.R:59:3
  5.     ├─base::do.call(...) at etn/R/conduct_parent_to_helpers.R:47:5
  6.     └─etnservice (local) `<fn>`(...)
  7.       ├─DBI::dbGetQuery(connection, dwc_occurrence_sql) at etnservice/R/write_dwc.R:98:3
  8.       └─DBI::dbGetQuery(connection, dwc_occurrence_sql)
  9.         └─odbc (local) .local(conn, statement, ...)
 10.           ├─DBI::dbSendQuery(...)
 11.           └─odbc::dbSendQuery(...)
 12.             └─odbc (local) .local(conn, statement, ...)
 13.               └─odbc:::OdbcResult(...)
 14.                 └─odbc:::new_result(p = connection@ptr, sql = statement, immediate = immediate)

[ FAIL 11 | WARN 2 | SKIP 7 | PASS 416 ]
══ Terminated early ═══════════════════════════════════════════════════════════════════
``

@PietrH PietrH linked an issue Apr 23, 2025 that may be closed by this pull request
PietrH added 2 commits April 23, 2025 16:09
…s' of github.com:inbo/etn into 316-use-etnservice-as-a-dependency-and-drop-_sql-helpers
@PietrH
Copy link
Member Author

PietrH commented Apr 23, 2025

Deployed a patch to etnservice for depth_in_meters but it isn't present in the deployment (that was successful, I checked). To be continued!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants