Skip to content

Using pandas-path on the right side of / with cloudpathlib #12

Open
@ejm714

Description

@ejm714

I'm trying to create a dataframe with two column, one that has the original filepath and one that has the destination filepath so that I can iterate over the dataframe and do something like

for row in df.itertuples():
   row.original_filepath.copy(row.final_filepath)

These paths will be s3 paths.

However, when I go to set up the filepaths with chaining, the second slash in s3:// gets dropped, making the result an invalid s3path

> S3_DATA_DIR / "raw" 
S3Path('s3://mybucket/data/raw')

> str(S3_DATA_DIR / "raw")
's3://mybucket/data/raw'

> str(S3_DATA_DIR / "raw") / df.audio_string.path
0        s3:/mybucket/data/r...
1        s3:/mybucket/data/r...

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions