International-Soil-Radiocarbon-Database / ISRaD

Repository for the development and release of ISRaD data and tools
https://international-soil-radiocarbon-database.github.io/ISRaD/
24 stars 15 forks source link

web QAQC flx_name error #85

Closed jb388 closed 6 years ago

jb388 commented 6 years ago

@greymonroe Templates that pass QAQC in R are failing the web-based QAQC with an error related to the new flx_name column. The error isn't a standard "warning" in the QAQC report, but rather a server error:

Server error: object 'flx_name' not found

In call: .f(.x[[i]], ...)

Strangely it's only the flx_name column that causes the error, not the ist_name or inc_name columns that were added at the same time. Additionally, I merged dev with master this morning, so the QAQC script should be the same for both web and R. Any insight?

greymonroe commented 6 years ago

@jb388 Do all templates produce this error? If not, do the ones that are failing contain the "flx_name" column?

I noticed in the QAQC function there are new lines that call on columns directly. For example, line 289, refers to flx_name and if that was not found in the data file being checked it might cause the code to break.

jb388 commented 6 years ago

All the templates missing "flx_name" do. I called the column directly because I was getting errors stemming from the plot name column. I'll have to think about a work around.

greymonroe commented 6 years ago

A quick fix would be adding an if statement preceding that line which would check if the columns were present before running the code

On Oct 18, 2018, at 9:17 AM, Jeff B notifications@github.com wrote:

All the templates missing "flx_name" do. I called the column directly because I was getting errors stemming from the plot name column. I'll have to think about a work around.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/International-Soil-Radiocarbon-Database/ISRaD/issues/85#issuecomment-431049701, or mute the thread https://github.com/notifications/unsubscribe-auth/AP5w_HHX3gd9Qcbq-mNmLHdi4WBsI0p4ks5umJuXgaJpZM4Xj9Tz.

jb388 commented 6 years ago

Yeah, that was my thought, too. Alternatively I was looking into how to select the relevant columns without referencing them directly. But I think it's easier to add the if statement, even though I prefer to keep the code consistent---makes it easier to look at.

jb388 commented 6 years ago

Ah, turns out it's easy. Just had the syntax wrong.

jb388 commented 6 years ago

Or not. But easy enough to add an if statement.