You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/10/07 05:25:39 UTC
[GitHub] [arrow-datafusion] unvalley opened a new pull request, #3750: Fix `ListingTableUrl` to decode percent
unvalley opened a new pull request, #3750:
URL: https://github.com/apache/arrow-datafusion/pull/3750
# Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
-->
Closes #3589
# Rationale for this change
<!--
Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
-->
# What changes are included in this PR?
<!--
There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
-->
- Add `percent_encoding` crate to `datafusion/core` to decode percent encoded url path.
# Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be updated before approving the PR.
-->
<!--
If there are any breaking changes to public APIs, please add the `api change` label.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] unvalley commented on a diff in pull request #3750: Fix `ListingTableUrl` to decode percent
Posted by GitBox <gi...@apache.org>.
unvalley commented on code in PR #3750:
URL: https://github.com/apache/arrow-datafusion/pull/3750#discussion_r989695131
##########
datafusion/core/Cargo.toml:
##########
@@ -80,6 +80,7 @@ ordered-float = "3.0"
parking_lot = "0.12"
parquet = { version = "24.0.0", features = ["arrow", "async"] }
paste = "^1.0"
+percent-encoding = "2.2.0"
Review Comment:
`datafusion/core` uses `url` crate by servo.
`percent-encoding` is also published by [the same repository](https://github.com/servo/rust-url/tree/master/percent_encoding).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] ursabot commented on pull request #3750: Fix `ListingTableUrl` to decode percent
Posted by GitBox <gi...@apache.org>.
ursabot commented on PR #3750:
URL: https://github.com/apache/arrow-datafusion/pull/3750#issuecomment-1274614036
Benchmark runs are scheduled for baseline = ac1631aa6db411c78b38d3a70ccaeb6a89a83673 and contender = 2352f3e9a7adf0394bfb166bb6e331db3075fbc4. 2352f3e9a7adf0394bfb166bb6e331db3075fbc4 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ec2-t3-xlarge-us-east-2] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/9110901132bd41589babb4c2a1fde906...da13f1046b5a4b9593470a0bb015c360/)
[Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on test-mac-arm] [test-mac-arm](https://conbench.ursa.dev/compare/runs/e3e0062f169543bc99baa6e1f446b78c...a06a538b6bf342199fb82261b177d2f0/)
[Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ursa-i9-9960x] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/ba2ea43598b3449f91522e4fdd5d9551...dd0ec1c105d949529413b5a9d9082b9d/)
[Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ursa-thinkcentre-m75q] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/c088751e07624cdbbced2093b93fd063...d88719cc08974c4db6019dadbee7ff46/)
Buildkite builds:
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] unvalley commented on a diff in pull request #3750: Fix `ListingTableUrl` to decode percent
Posted by GitBox <gi...@apache.org>.
unvalley commented on code in PR #3750:
URL: https://github.com/apache/arrow-datafusion/pull/3750#discussion_r989698337
##########
datafusion/core/src/datasource/listing/url.rs:
##########
@@ -108,7 +109,8 @@ impl ListingTableUrl {
/// Creates a new [`ListingTableUrl`] from a url and optional glob expression
fn new(url: Url, glob: Option<Pattern>) -> Self {
- let prefix = Path::parse(url.path()).expect("should be URL safe");
+ let decoded_path = percent_encoding::percent_decode_str(url.path()).decode_utf8_lossy();
Review Comment:
the `url.path()`, it is still percent encoded string.
`percent_decode_str` decodes it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] tustvold commented on pull request #3750: Fix `ListingTableUrl` to decode percent
Posted by GitBox <gi...@apache.org>.
tustvold commented on PR #3750:
URL: https://github.com/apache/arrow-datafusion/pull/3750#issuecomment-1273360974
I think this just needs a cargo fmt and then we can get it in 😃
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] unvalley commented on pull request #3750: Fix `ListingTableUrl` to decode percent
Posted by GitBox <gi...@apache.org>.
unvalley commented on PR #3750:
URL: https://github.com/apache/arrow-datafusion/pull/3750#issuecomment-1271478747
@alamb PTAL?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] unvalley commented on a diff in pull request #3750: Fix `ListingTableUrl` to decode percent
Posted by GitBox <gi...@apache.org>.
unvalley commented on code in PR #3750:
URL: https://github.com/apache/arrow-datafusion/pull/3750#discussion_r990149340
##########
datafusion/core/src/datasource/listing/url.rs:
##########
@@ -246,6 +248,9 @@ mod tests {
let url = ListingTableUrl::parse("file:///foo").unwrap();
let child = Path::parse("/foob/bar").unwrap();
assert!(url.strip_prefix(&child).is_none());
+
+ let url = ListingTableUrl::parse("file:///with space/foo/bar").unwrap();
Review Comment:
Thanks. I added some test cases at 439f6dc
if it's not enough or wrong to test, please tell me about it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] alamb merged pull request #3750: Fix `ListingTableUrl` to decode percent
Posted by GitBox <gi...@apache.org>.
alamb merged PR #3750:
URL: https://github.com/apache/arrow-datafusion/pull/3750
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] unvalley commented on a diff in pull request #3750: Fix `ListingTableUrl` to decode percent
Posted by GitBox <gi...@apache.org>.
unvalley commented on code in PR #3750:
URL: https://github.com/apache/arrow-datafusion/pull/3750#discussion_r989695131
##########
datafusion/core/Cargo.toml:
##########
@@ -80,6 +80,7 @@ ordered-float = "3.0"
parking_lot = "0.12"
parquet = { version = "24.0.0", features = ["arrow", "async"] }
paste = "^1.0"
+percent-encoding = "2.2.0"
Review Comment:
`datafusion/core` uses `url` crate by servo.
`percent-encoding` is also published by [same repository](https://github.com/servo/rust-url/tree/master/percent_encoding).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] tustvold commented on a diff in pull request #3750: Fix `ListingTableUrl` to decode percent
Posted by GitBox <gi...@apache.org>.
tustvold commented on code in PR #3750:
URL: https://github.com/apache/arrow-datafusion/pull/3750#discussion_r990014407
##########
datafusion/core/src/datasource/listing/url.rs:
##########
@@ -108,7 +109,8 @@ impl ListingTableUrl {
/// Creates a new [`ListingTableUrl`] from a url and optional glob expression
fn new(url: Url, glob: Option<Pattern>) -> Self {
- let prefix = Path::parse(url.path()).expect("should be URL safe");
+ let decoded_path = percent_encoding::percent_decode_str(url.path()).decode_utf8_lossy();
Review Comment:
I think this will cause the parse call below to fail in the event of non-ASCII characters.
I think it should just be a case of change `Path::parse` to `Path::from`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] tustvold commented on a diff in pull request #3750: Fix `ListingTableUrl` to decode percent
Posted by GitBox <gi...@apache.org>.
tustvold commented on code in PR #3750:
URL: https://github.com/apache/arrow-datafusion/pull/3750#discussion_r990015784
##########
datafusion/core/src/datasource/listing/url.rs:
##########
@@ -246,6 +248,9 @@ mod tests {
let url = ListingTableUrl::parse("file:///foo").unwrap();
let child = Path::parse("/foob/bar").unwrap();
assert!(url.strip_prefix(&child).is_none());
+
+ let url = ListingTableUrl::parse("file:///with space/foo/bar").unwrap();
Review Comment:
Could we get a test of a non-ASCII character such as a percent encoded emoji or something
We should also test non-URL safe characters like a percent encoded `?`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] unvalley commented on a diff in pull request #3750: Fix `ListingTableUrl` to decode percent
Posted by GitBox <gi...@apache.org>.
unvalley commented on code in PR #3750:
URL: https://github.com/apache/arrow-datafusion/pull/3750#discussion_r990149340
##########
datafusion/core/src/datasource/listing/url.rs:
##########
@@ -246,6 +248,9 @@ mod tests {
let url = ListingTableUrl::parse("file:///foo").unwrap();
let child = Path::parse("/foob/bar").unwrap();
assert!(url.strip_prefix(&child).is_none());
+
+ let url = ListingTableUrl::parse("file:///with space/foo/bar").unwrap();
Review Comment:
Thanks. I added some test cases at 439f6dc
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] unvalley commented on pull request #3750: Fix `ListingTableUrl` to decode percent
Posted by GitBox <gi...@apache.org>.
unvalley commented on PR #3750:
URL: https://github.com/apache/arrow-datafusion/pull/3750#issuecomment-1273502001
@tustvold Oh sorry, I added a commit for that😺
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org