Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic bulk submission support #39

Merged
merged 7 commits into from
Jan 3, 2024
Merged

Basic bulk submission support #39

merged 7 commits into from
Jan 3, 2024

Conversation

richfitz
Copy link
Member

@richfitz richfitz commented Dec 22, 2023

This PR allows submission of a group of tasks like:

data <- data.frame(a = 1:3, b = c("x", "y", "z"))
task_create_bulk_expr(f(a, b), data)

which will end up creating three tasks

f(1, "x")
f(2, "y")
f(3, "z")

We do this by binding each row of the df into a local variable that we make available when the task runs.

I've got the beginnings of rlang's metaprogramming support working here so that the user can use !! to pull a value in from the parent environment where things are ambiguous, e.g.

a <- 10
task_create_bulk_expr(f(!!a, b), data)

will submit all three tasks with a as 10 rather than the value from the df!

We'll certainly tweak this as we go on, but this makes a reasonable starting point I think

@richfitz richfitz marked this pull request as ready for review December 22, 2023 13:27
Copy link
Contributor

@weshinsley weshinsley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok - I had to stare and poke at lines 42-56 a bit, especially about the !!, and think I see how it works just about enough!

@richfitz richfitz merged commit c93faf2 into main Jan 3, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants