Unexpected bugs due to data encoding or others things like breakpoint in csv #379
Unanswered
kikislater
asked this question in
Q&A
Replies: 1 comment 2 replies
-
I've no idea where the user modified the file, and I think this where you should first investigate the matter. We use the standard readr package This example let you attempt reading the entity from your csv: require(geoflow)
config = geoflow::add_config_utils(list()) #empty config (only with logger utils)
source = "path to your csv file"
handlers = geoflow::list_entity_handlers(raw = T)
csv_entity_handler = handlers[sapply(handlers, function(h){h$id == "csv"})][[1]]
handle_entities_df <- source(system.file("metadata/entity", "entity_handler_df.R", package = "geoflow"))$value
entities <- handle_entities_df(csv_entity_handler, source, config) In case you spot out errors downstream in the workflow, let me know |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I write a csv from code using a programming language like python. Then I send the csv to another user. I don't know in which editor the user modifies the csv but the modified file results in an R breakpoint (red dot, screenshot available below) only visible in RStudio (gedit, geany, vscodium, nano do not display these breakpoints).
File is available here: nosysakatia_zenodo-rawdata.csv @juldebar : this is your csv ^^
Finally, when I run a geoflow workflow with this csv, an error is generated. Removing the breakpoints allows the workflow to work, of course. To avoid this kind of error, it would be good to have a control to remove these breakpoints.
Finally, this made me think of something else. I'm used to receiving csvs or dbfs from shapefiles with different types of user and I then run into problems in different programming languages. It is common to include a dict to convert some data to other data. Perhaps by implementing this removal of "R breakpoints", it would be good to have a dictionary to handle bad encodings!
Example of hardcoding dict:
Sylvain
Beta Was this translation helpful? Give feedback.
All reactions