-
Notifications
You must be signed in to change notification settings - Fork 48
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
redcap_metadata_read, "object 'ds' not found" #269
Comments
Actually, this is more of a thing and is actually breaking. For some reason every time I use it I get that same error and nothing is returned. I'm having a hard time troubleshooting this more to give you more info. When I step through, ETA: I see now -
I can get valid data down from this project, so it's not the project that's the problem (I was suspicious). But clearly that isn't the payload your other functions are looking for so it breaks later. But I can get column types and such. I wonder if some of the other packages have been updated and thus behaving oddly? |
@vortexing, thanks for digging in. I see what you're saying about a package dependency possibly changed. May I aska few questions?
|
REDCap version is 9.3.6 The data frame that comes back has the column names all messed up (they are some of my field names!), and then the entire data frame is duplicated field names that are valid, but all jumbled into one data frame. I will continue to dig a bit. |
With the current github version I can again, change the parsing/text/csv parameters in the httr call in IF I do the following, the redcap_metadata_read will work for me:
ETA: I'm not sure what possible REDCap metadata structure you're anticipating might cause an error if the above changes were in there, but for my, very simple REDCap project, the metadata structure that comes down is pretty straightforward and always parsable into a csv. |
@vortexing thanks for narrowing it down to I assume you're using relatively recent version of httr & readr (and curl, which is underneath httr)? I don't any other REDCapR dependencies that are likely involved here. I started a new branch, will you see if this fixes it? I'd still like to see your codebook, because I'm hoping there's something in there that is making However I'm reluctant to ask httr to parse it into a tibble (which it does using
If this doesn't fix it, do you have time for a webex? If so, can you email me your address at [email protected]? This metadata function is called by important functions like |
@vortexing, even if it does work, will you please tell me the value of I'm particularly curious about
If there's nothing suspicious, will you see if |
This just in! I took a gander at my data dictionary when manually downloading it from a browser. I noticed two strange characters in one of my field descriptions. I deleted that, reuploaded it, then tested your functions again and it worked!!! So I think now I can't do the above testing b/c content type now is correct like you have above. I think the lesson here is that there CAN be things in a REDCap data dictionary that won't break REDCap but will impact whether or not we can parse it normally in R when it gets pulled down. I have no idea where those characters would've come from, why they were in only one field description and I don't remember what they were (one was the copyright symbol but that's allI remember). I think your function is fine, BUT there must be things that break Sorry for the sort of false alarm - thanks for helping me figure out where the problem was!!! |
That's great news. I'm glad it worked out. I'd like to make REDCapR routines as robust to this as possible (using nondynamic defaults and helpers like The metadata is used by several other important REDCapR functions, and I don't want problems to cascade to other areas. If REDCapR can't gracefully fix it, I'd at least like to give a better error message so the user can jump on it quicker. Is it ok with you and your team if you send me the bad data dictionary (or at least Judging from the great debugging skills that you demonstrated above, if it took you some time to isolate and identify the problem, most REDCap users don't have a chance if it happens to them. And this may not be such a fluke --I'm wondering if a bad dictionary was uploaded after modifying it in Excel (and Excel added the copyright symbol and other problem). |
This project is not in production right now, but I actually had never had to look up a previous version of the data dictionary, so thanks for that tidbit! I will email you the previous data dictionary and the current. It's a small project but you can see what changes I made between the broken vs fixed versions. There were small formatting changes, removal of extra lines in field descriptions, etc, I made too that I don't THINK were the issue. Perhaps in this test setup you can have both the formatting marks and weird symbols (turns out it WASN'T a copyright, it was a Thanks for working on this package!! It's saved me a TON of time and let me build on REDCap for really cool other things too! |
Note to others: @vortexing worked out some things and sent me the problematic lines in the data dictionary. It's now in the test suite as problematic-dictionary.csv and test-metadata-read.R. If anyone encounters something similar, please consider
If we can't find a way for REDCapR to gracefully adapt, we'll at least try to provide a better error message. Thanks again to @vortexing and @plitwin! |
This call was previously working but REDCapR_0.10.2 now gives me this error:
Just FYI.
The text was updated successfully, but these errors were encountered: