rstudio / rstudio/pins-python

RSConnect: speed up pin_search by allowing using guid behind the scenes

Open
#79 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

.compatibility .epic .ux be:rsc core:filesystem
Dominant language
Python
Stars
59
Forks
11
PR merge metrics
No merged PRs in 30d

Description

Currently, python pins with RSConnect needs to look up the user and content guid for actions like

fs.info("michael.chow/mtcars")

however, looking up the user guid requires iterating through all users. This is an expensive operation that R pins does as little as possible by using the guids whenver possible (through a local cache file).

Let's support something like

# similar protocol format to sqlalchemy uris
# may need to use "rsc://guid+<user_guid>
fs.info("rsc+guid://<user_guid>")                  # GET v1/users/{guid}
fs.info("rsc+guid://<user_guid>/<content_name>")   # GET v1/content?name=<content_name>?user_guid=<user_guid>

fs.info("rsc+guid://content/<content_guid>")       # GET v1/content/<content_guid>

Note that we must meet these criteria...

  • Files are cached correctly (e.g. could use the guids for everything in the cache)
  • Users do not need to specify guid in pin_* methods
  • We could allow users to specify guid in pin_* methods if it's not a lot of work. Otherwise, could start by having pins use it as an internal fast path.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing pin_search and the RSConnect user and content GUID lookup paths, then inspect how files are cached. Use the proposed rsc+guid URI forms and the listed API requests as the behavioral guide. Done means cached files can use GUIDs, ordinary pin_* calls still work without user-supplied GUIDs, and the internal fast path is covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.