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] FileSystem.from_uri doesn't decode %-encoded characters in path #33598
Traceback (mostrecentcalllast):
File"/Users/james/projects/dask/dask/test.py", line3, in <module>
result = FileSystem.from_uri("s3://nyc-tlc/trip data/fhvhv_tripdata_2022-06.parquet")
File"pyarrow/_fs.pyx", line470, inpyarrow._fs.FileSystem.from_uriFile"pyarrow/error.pxi", line144, inpyarrow.lib.pyarrow_internal_check_statusFile"pyarrow/error.pxi", line100, inpyarrow.lib.check_statuspyarrow.lib.ArrowInvalid: CannotparseURI: 's3://nyc-tlc/trip data/fhvhv_tripdata_2022-06.parquet'
Note that things work if I use a different dataset that doesn't have a space in the URI, or if I replace the portion of the URI that has a space with a \* wildcard
frompyarrow.fsimportFileSystemresult = FileSystem.from_uri("s3://ursa-labs-taxi-data/2009/01/data.parquet") # worksresult = FileSystem.from_uri("s3://nyc-tlc/*/fhvhv_tripdata_2022-06.parquet") # works
The wildcard isn't necessarily equivalent to the original failing URI, but I think highlights that the space is somehow problematic.
Environment: - OS: macOS
python=3.9.15:h709bd14_0_cpython (installed from conda-forge)
Activity
asfimport commentedon Dec 14, 2022
Antoine Pitrou / @pitrou:
That's because the space needs to be encoded. However, there is an issue that it isn't decoded on return:
asfimport commentedon Jan 3, 2023
Antoine Pitrou / @pitrou:
Issue resolved by pull request 14974
#14974