You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Python] pyarrow.fs.copy_files doesn't work if filenames contain special characters #33468
Miles Granger / @milesgranger:
Hmm, seems like one way for Arrow to fix this is to do something similar as described in this issue [aws-sdk-cpp #1224 | https://github.com/aws/aws-sdk-cpp/issues/1224], subclassing our own client which does the URI::URLEncodePath as suggested:
I've found one thing that DOES work. I'm not suggesting that this is the fix, but it does seem to give the desired behavior, at least for this test case. In URI::GetURIString(), m_path is escaped using URLEncodePathRFC3986() which explicitly checks for and does not percent encode the "=". If this call is replaced with a similar one that does escape the "=" (and only done here. URLEncodePathRFC3986() is called in a few places), the resulting URL becomes this:
And [the comment about a new client class | https://github.com/aws/aws-sdk-cpp/issues/1224#issuecomment-525061745] to circumvent this issue.
Antoine Pitrou / @pitrou:
Hmm... that is weird to say the least. What does the S3-emulating filesystem expect exactly? Can you upload a file "spam=ham" using their native API?
Antoine Pitrou / @pitrou:
I'll note that the GH comment quoted above seems outdated: in a recent version of the AWS SDK (1.9.259), URLEncodePathRFC3986 is still defined but isn't used anywhere. URI::GetURLEncodedPathRFC3986 is used via URI::GetURIString, though.
Antoine Pitrou / @pitrou:
I also don't know how we would override that behavior. We would have to reimplement every URI::GetURIString-calling function, such as CurlHttpClient::MakeRequest.
Miles Granger / @milesgranger:
Ok, I suppose the main thing is this works when a real S3 bucket is used ( just tried it now). I'll experiment a bit with the native API, but even if that doesn't work, I suppose supporting 'all' s3 like systems isn't within scope.
Antoine Pitrou / @pitrou:
Well, we would like our S3 support to extend to non-AWS backends, as a best effort policy, but we also can't introduce unreasonable hacks to that purpose. This particular issue seems difficult to solve without extended surgery and a hairy maintenance story.
Antoine Pitrou / @pitrou:
That said, I'm still interested to know: if you manage to create "spam=ham" using the native API, what does it look like when you list files using the S3 API?
Activity
asfimport commentedon Nov 14, 2022
Miles Granger / @milesgranger:
Hmm, seems like one way for Arrow to fix this is to do something similar as described in this issue [aws-sdk-cpp #1224 | https://github.com/aws/aws-sdk-cpp/issues/1224], subclassing our own client which does the
URI::URLEncodePathas suggested:And [the comment about a new client class | https://github.com/aws/aws-sdk-cpp/issues/1224#issuecomment-525061745] to circumvent this issue.
What do you think, @pitrou?
asfimport commentedon Nov 14, 2022
Antoine Pitrou / @pitrou:
Hmm... that is weird to say the least. What does the S3-emulating filesystem expect exactly? Can you upload a file "spam=ham" using their native API?
asfimport commentedon Nov 14, 2022
Antoine Pitrou / @pitrou:
I'll note that the GH comment quoted above seems outdated: in a recent version of the AWS SDK (1.9.259),
URLEncodePathRFC3986is still defined but isn't used anywhere.URI::GetURLEncodedPathRFC3986is used viaURI::GetURIString, though.asfimport commentedon Nov 14, 2022
Antoine Pitrou / @pitrou:
I also don't know how we would override that behavior. We would have to reimplement every
URI::GetURIString-calling function, such asCurlHttpClient::MakeRequest.asfimport commentedon Nov 14, 2022
Miles Granger / @milesgranger:
Ok, I suppose the main thing is this works when a real S3 bucket is used ( just tried it now). I'll experiment a bit with the native API, but even if that doesn't work, I suppose supporting 'all' s3 like systems isn't within scope.
asfimport commentedon Nov 14, 2022
Antoine Pitrou / @pitrou:
Well, we would like our S3 support to extend to non-AWS backends, as a best effort policy, but we also can't introduce unreasonable hacks to that purpose. This particular issue seems difficult to solve without extended surgery and a hairy maintenance story.
asfimport commentedon Nov 14, 2022
Antoine Pitrou / @pitrou:
That said, I'm still interested to know: if you manage to create "spam=ham" using the native API, what does it look like when you list files using the S3 API?
asfimport commentedon Nov 14, 2022
Miles Granger / @milesgranger:
Seems like it works fine:
(using the same docker emulator as OP)
asfimport commentedon Nov 15, 2022
Antoine Pitrou / @pitrou:
Ok, it seems this should be solvable with a new enough AWS SDK.
asfimport commentedon Nov 15, 2022
Antoine Pitrou / @pitrou:
Issue resolved by pull request 14645
#14645