Skip to content

Implement pin_download, pin_upload #32

@machow

Description

@machow

Background

For parity with R pins, a user should be able to do the following:

  • upload (R code)
    • accept a List[str] | str of paths to files to upload
    • bundle up as a pin version of type "files"
    • take largely the same arguments as pin_write: name, title, description, metdata
    • create one flat list of all files and directories (included those within subdirectories, etc..)
      • e.g. ['a', 'a/b', 'a/b/file.txt']
    • delegates version uploading to pin_store
  • download
    • basically equivalent to pin_read, with type="files" set in data.txt.
    • the R version returns a local cache path, so the python version should return the remote path, since caching happens through wrapping the remote filesystem (???).

Notes on RStudio Connect

Since RStudio Connect already uploads a bunch of files by default (e.g. data.txt, index.html, js assets), the mechanism exists to pin_store arbitrary files / directories. One issue in the R pins implementation is in the following flow:

  • Internally, files are just dumped at the top-level first, then its default index.html is added.
  • A user attempting to pin_upload "index.html" would have it overwritten by the one pins generates.

Research needed

  • Is there a need for pin_download in python pins? Should it download locally by default (e.g. into a folder, similar to what R pins is calling the cache)?
  • How does pin_read(...) when type is "files", differ from pin_download?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions