Specify which environment to import in importEnv

Open
#225 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
r

Research direction

The issue names the jobRunScript entry point and its importEnv argument but no files or tests. Start by locating their implementation and current environment-copying behavior, then review how an environment or list could be specified. Done should be defined by importing only the requested bindings rather than the full global environment.

Written by the indexing model from the issue text.

Description

I often work in environments of several GB of objects. When running a job via jobRunScript, it takes an impermissible long time to copy that environment (> 5 minutes). I'd like to only include a subset of my environment. I suggest that importEnv could be an environment instead of only TRUE/FALSE.

So an everyday use case would be

# Earlier in globalenv()
x = "hi"
y = rnorm(10)

# Launching job
job_env = new.env()
job_env$x = x
job_env$y = y
jobRunScript("my_file.R", "result_env", importEnv = job_env)

Alternatively, you could just pass a list to importEnv.

Dominant language
R
Stars
175
Forks
37
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

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.

More from rstudio/rstudioapi

All issues in rstudio/rstudioapi

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.