universal_pathlib icon indicating copy to clipboard operation
universal_pathlib copied to clipboard

`.parents` returns an empty path as the last element

Open Koncopd opened this issue 2 months ago • 1 comments

Another attempt to upgrade.

from upath import UPath
filepath = UPath("s3://lamindb-ci/test-data/Species.csv")
filepath.parents
# on 0.3.7
>>(S3Path('lamindb-ci/test-data', protocol='s3'), S3Path('lamindb-ci/', protocol='s3'), S3Path('', protocol='s3'))
list(filepath.parents) # on 0.2.6
>> [S3Path('s3://lamindb-ci/test-data'), S3Path('s3://lamindb-ci/')]

This looks like a bug to me. Or is this intended?

Koncopd avatar Dec 30 '25 11:12 Koncopd

Thanks for reporting @Koncopd !

This does indeed look like a bug and needs additional tests for .parents in the JoinablePath base test suite.

ap-- avatar Dec 30 '25 12:12 ap--