-
Notifications
You must be signed in to change notification settings - Fork 70
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
Problems with type of unsubscribed
(logical vs. character)
#304
Comments
v0.3.4 or v0.3.5 seem fine, this came in v1.0.0 |
Thanks for the input! Yes, this is something we'll need to deal with, likely in the pending functions in #275. |
After looking into this, this appears to be a different issue? The problem here is with And I'm not sure why. "unsubscribed" is a built-in variable from Qualtrics that should always download as TRUE/FALSE. I tried to get it to do otherwise but was unsuccessful. I can generate that error by manually intervening mid-function to change an "unsubscribed" elements to, say, "Y", but I haven't seen it natively. Is there anything about your lists that might be relevant to this? Still, what you're describing seems identical to what @benhmin mentioned in #275, so it appears to be possible. @benhmin did note that those other in-development functions (using the newer API endpoint) seemed to be working. |
Yes, sorry, I was wrong on the error diagnosis (reverted to older version of purrr but same issue). Inspecting the function, yes, for some reason the vector is coming through character:
This is inside the
Could also be something related to curl? |
I'm probably going to fix this for myself for the time being by forking the project and adding an |
Specifically, I changed the code to the following, which makes the error go away:
However, I don't know why the vector came through as character originally, so obviously not a good long-term fix. |
That would work for your case, except (kind of amusingly) it now makes the purrr 1.0 change relevant again--it will throw a warning (for now) in normal cases because As an alternative, I added this line just before the call to elements <-
purrr::map(elements, ~purrr::modify_in(.x, "unsubscribed", as.logical)) which takes advantage of I think that should work while preserving standard function, so went ahead and made a PR for it. It's a minor kluge, though, so let me run it by @juliasilge first. |
As for why you're getting that, I don't know. The two relevant functions (deep inside the API request) seem to be Looking at my test mailinglist, I got this from "{\"result\":{\"elements\":[{\"id\":\"MLRP_71HUvIwwYAFyJDg\",\"firstName\":\"test1\",\"lastName\":\"test1\",\"email\":\"test1@test.com\",\"externalDataReference\":\"1\",\"embeddedData\":null,\"language\":\"null\",\"unsubscribed\":false,\"responseHistory\":[],\"emailHistory\":[]},{\"id\":\"MLRP_3g95Ibu9YWUTurI\",\"firstName\":\"test2\",\"lastName\":\"test2\",\"email\":\"test2@test.com\",\"externalDataReference\":\"2\",\"embeddedData\":null,\"language\":\"null\",\"unsubscribed\":false,\"responseHistory\":[],\"emailHistory\":[]},{\"id\":\"MLRP_blxRKsifuS2gYL4\",\"firstName\":\"test3\",\"lastName\":\"test3\",\"email\":\"test3@test.com\",\"externalDataReference\":\"3\",\"embeddedData\":null,\"language\":\"null\",\"unsubscribed\":true,\"responseHistory\":[],\"emailHistory\":[]},{\"id\":\"MLRP_6ssleCfefL6DcRE\",\"firstName\":\"test4\",\"lastName\":\"test4\",\"email\":\"test4@test.com\",\"externalDataReference\":\"4\",\"embeddedData\":null,\"language\":\"null\",\"unsubscribed\":true,\"responseHistory\":[],\"emailHistory\":[]},{\"id\":\"MLRP_3F9eSZcDSemfaRg\",\"firstName\":\"test5\",\"lastName\":\"test5\",\"email\":\"test5@test.com\",\"externalDataReference\":\"5\",\"embeddedData\":null,\"language\":\"null\",\"unsubscribed\":true,\"responseHistory\":[],\"emailHistory\":[]}],\"nextPage\":null},\"meta\":{\"httpStatus\":\"200 - OK\",\"requestId\":\"08b774ef-9c12-45d4-bfc5-30f743ca6273\"}}" The first element looks like this, with {
"result": {
"elements": [
{
"id": "MLRP_71HUvIwwYAFyJDg",
"firstName": "test1",
"lastName": "test1",
"email": "test1@test.com",
"externalDataReference": "1",
"embeddedData": null,
"language": "null",
"unsubscribed": false,
"responseHistory": [],
"emailHistory": []
}
]
} If you're getting something different, then it's either there or upstream of there (e.g., in curl), and if not it's likely something with Might not matter if this fix works, but bringing it up anyway in case you're curious, plus it might be good to know whether we'll need to anticipate this occasional behavior for the planned update that will replace this function. |
unsubscribed
(logical vs. character)
An unfortunate new change as of purrr v1.0:
This is causing an error in the
fetch_mailinglist
function:The text was updated successfully, but these errors were encountered: