-
Notifications
You must be signed in to change notification settings - Fork 71
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
fetch_survey error; filename issue? #329
Comments
Yes, that's right. You can read more in #195 about the kinds of problems that people run into with special characters in their survey titles, which translates to special characters in a filename which of course is no good. Since #195 was opened, we have taken on a fs dependency so we could consider using |
Oh wait, remotes::install_github("ropensci/qualtRics") |
alright, now I'm getting a different error:
how do I go about utilizing Also, a follow up question. Why not use the survey ID as the filename? or is that something qualtrics is doing (which would not surprise me at all)? |
Wow @jmobrien look at the filename we are ending up with: 👀
This may be difficult to sanitize, actually. Yes @BeardedJayhawk the filenames are coming from Qualtrics, not the R package. |
is it possible to edit the survey name through the API? you could check for problem characters, change it, fetch the data, then change it back... |
OK, so I looked around the API documentation and it appears that it is possible to rename a survey: https://api.qualtrics.com/70532f4d66766-update-survey so maybe temporarily change the name of the survey to match the survey ID, pull down the file, then change it back? not sure how much of a delay that would cause, but that should address any filename issues, right? |
I don't know that we would want to do that from In #215 we discuss supporting an |
Wow, missed this somehow, notice, sorry. Yeah, that's some wild file naming. Let me review the code and see if I can figure something out. At a glance, I'm not sure I'm tracking what's going on. The zip file name is randomly generated now (e.g., file1a3444523ed2.zip, see here), so that error message doesn't make a lot of sense to me. It's true that it is possible to rename surveys (the unfinished PR #266 covers this, actually), but I think we should be reluctant to make server-side changes just to fix things on our end. |
Okay, still haven't checked this deeply, but just wondering--is the second example the same colon issue, or something different? The zip file should be (randomly) named, say If we're requesting file But, for a survey with a colon in the name (say a survey
That's not what we see here--but @BeardedJayhawk you did say you cleaned up some things in the error message for privacy reasons, yes? Just checking--what exactly did the second error look like (within what you are fine disclosing, of course)? |
all I changed was "username" and "Survey Name" in the error message. for context, here's that applied to the full survey name: "Survey Name: The Company Survey - 2023-03 March Form" everything occurring after the colon in the survey name does not appear in the error message, nor did ".csv" here's a question, if I go to "C:/Users//AppData/Local/Temp/RtmpEnkXdF/", should I be seeing a .zip file there? Because I'm not. |
@BeardedJayhawk Yes, it should be there, but only while the function is running. In this most recent version we try to ensure its deletion as soon as the function call ends, to give people better control over where their response data goes. However, if you run @juliasilge I'm seeing the same issue. If I download the responses from a survey called This is a tough one. Maybe there's a way to properly reference the internal file, but if so I'm not sure how yet. |
So, the issue here is with the foundational C code in R that makes connections, so this is way above my pay grade (unpaid grade?). I do see another way around it that could work on my system, but I'm not sure if it would work across platforms @BeardedJayhawk if you grab the file out during debugging as described above, then extract the file manually (using the OS), what is the file name you get? |
This doesn't surprise me, given the pretty wacky filename. I would like to suggest that the best option here is to return to the work on |
Yes, that makes sense; we should enable users to handle this themselves. |
@jmobrien so when I choose "extract all" from the context menu I get a windows error that says
if I choose "skip" on the error, when I look at the extracted file, the file is there with the full filename except the colon in the filename was replaced with an underscore. If I use 7zip it does the same thing, but without the error. |
OK, hopefully this helps. I found this solution, and applied it here. this is what I came up with, and it actually pulls the data into R
|
This could work, and is similar to what I was considering. Problem is, it effectively moves us back to something that we just moved away from--precisely because it was creating problems with different characters in survey names (and which I'm beginning to realize may actually be related to this...). So, it's complicated. Question for you--does the name in |
it does still have the colon in it, and appears to work. I came across this solution when I was looking for a way to change the filename of the .csv without extracting it because that step appears to be the source of the issue, and this solution bypasses it entirely. |
fetch_survey:export_responses_filedownload can use external unzip binary This streams zip file contents into a temporary csv file to avoid unz() TODO: check system('which unzip') or error?
fetch_survey:export_responses_filedownload can use external unzip binary This streams zip file contents into a temporary csv file to avoid unz() TODO: check system('which unzip') or error?
OK, when I attempt to run fetch_survey I get an error. This is the simplest version of the code that's causing issues:
mysurvey <- fetch_survey(surveyID = 'SV_0UFBbXXXXXXXXX')
and this is the error:
I of course edited out/changed some details, but one I did not change is the colon in the survey name. when I look at the temp directory there is a temp file named just "Survey Name".
Is the colon somehow causing the issue? This isn't happening with other surveys that don't have a colon in the name.
The text was updated successfully, but these errors were encountered: