inbo / etn

R package to access data from the European Tracking Network
https://inbo.github.io/etn/
MIT License
6 stars 5 forks source link

`write_dwc()` returns error: Expecting a single string value: [type=character; extent=0]. #293

Closed rubenpp7 closed 5 months ago

rubenpp7 commented 5 months ago

Hi,

I'm trying to run the following code but it gives me an error, could you take a look? data <- write_dwc(con, "2010_phd_reubens") Error Reading data and transforming to Darwin Core. Error: Expecting a single string value: [type=character; extent=0].

Thanks!

peterdesmet commented 5 months ago

Hi @rubenpp7 are you using the latest version of etn?

I noticed another bug in write_dwc() (does not create an output). @sannegovaert or @PietrH can you investigate? We will need this function fairly soon to transform data for DTO BioFlow.

rubenpp7 commented 5 months ago

Hi @peterdesmet

yes, I made sure that I had the latest version but the issue persists

PietrH commented 5 months ago

I'm looking into this, I'll post updates in this issue.

PietrH commented 5 months ago

I have found the cause of the issue, we are failing on this line:

https://github.com/inbo/etn/blob/326d9e8293c51080b87a3b8569f6a3df7291225f/R/write_dwc.R#L85-L88

Fix is in progress.

PietrH commented 5 months ago

I suspect this actually broke when one of our dependencies glue got updated to v1.7.0: https://github.com/tidyverse/glue/releases/tag/v1.7.0 as part of https://github.com/tidyverse/glue/issues/272.

rights_holder is set to NULL by default, resulting in an empty sql query being returned by glue::glue_sql(), setting rights_holder to "NULL" results in valid sql being returned.

I'm making headway.

PietrH commented 5 months ago

Fixed in branch, I'm opening a PR.

PietrH commented 5 months ago

@peterdesmet Could you review the PR?

PietrH commented 5 months ago

Hey Ruben,

It should be fixed now, just make sure you update to the latest version.

Thanks for making an issue!

On Fri, 21 Jun 2024, 18:29 Peter Desmet, @.***> wrote:

Closed #293 https://github.com/inbo/etn/issues/293 as completed via #294 https://github.com/inbo/etn/pull/294.

— Reply to this email directly, view it on GitHub https://github.com/inbo/etn/issues/293#event-13244759656, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALOW2O2WGU2IP5MOAIPXQI3ZIRIGRAVCNFSM6AAAAABJVSILDOVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJTGI2DINZVHE3DKNQ . You are receiving this because you were assigned.Message ID: @.***>