File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -515,11 +515,20 @@ def _get_prefix_content(
515515 logger .info ("Listing prefix=%s" , full_prefix )
516516 folders = []
517517 files = []
518+ prefix_len = len (full_prefix ) if full_prefix else 0
518519 for item in client .container .walk_blobs (name_starts_with = full_prefix ):
519520 item_name : str = cast (str , item .name )
520- name = os .path .relpath (item_name , full_prefix )
521+ # Use string slicing instead of os.path.relpath to extract
522+ # the name relative to the current prefix. walk_blobs
523+ # guarantees results start with full_prefix, so simple
524+ # slicing is correct and avoids os.path.relpath mis-handling
525+ # blob names that start with "/" (which produces "../../.."
526+ # relative paths on the filesystem).
527+ name = item_name [prefix_len :]
521528 if isinstance (item , BlobPrefix ):
522- folders .append (name .strip ("/" ))
529+ folder_name = name .strip ("/" )
530+ if folder_name :
531+ folders .append (folder_name )
523532 else :
524533 if item .size == 0 :
525534 # ADLS Gen 2 creates empty files as directory placeholders.
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ dependencies = [
3737 " opencensus-ext-logging>=0.1.1" ,
3838 " orjson>=3.0.0,<4" ,
3939 " planetary-computer==1.0.0" ,
40- " pystac= =1.10.1" ,
40+ " pystac> =1.10.1" ,
4141 " pydantic>=2.0.0" ,
4242 " pydantic-settings>=2.0.0" ,
4343 " python-dateutil>=2.8.2,<2.9" ,
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ dependencies = [
3030 " pctasks.task @ {root:parent:uri}/task" ,
3131 " plpygis>=0.5.0" ,
3232 " pypgstac[psycopg]==0.9.6" ,
33- " pystac= =1.10.1" ,
33+ " pystac> =1.10.1" ,
3434]
3535
3636[project .optional-dependencies ]
You can’t perform that action at this time.
0 commit comments