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

Breaking API Change: Apply Job Args to User's Work Function #28

Merged
merged 2 commits into from
Oct 15, 2024

Conversation

wiwichips
Copy link
Collaborator

This is a BREAKING API CHANGE which applies additional job arguments to the user's work function.

So for instance if a user passes job arguments to compute_for such as in the following example:

def my_work_fn(datum, a, b, c):
    dcp.progress()
    return datum + a + b + c

job = dcp.compute_for([7], my_work_fn, [10, 100, 1000])

...

print(job.wait()) # will print 1117

This is breaking since previoysly job args weren't applied so old user defined workfunctions will raise a typeerror.

This is a BREAKING API CHANGE which applies additional job arguments
to the user's work function.

So for instance if a user passes job arguments to `compute_for` such
as in the following example:

```python

def my_work_fn(datum, a, b, c):
    dcp.progress()
    return datum + a + b + c

job = dcp.compute_for([7], my_work_fn, [10, 100, 1000])

...

print(job.wait()) # will print 1117
```

This is breaking since previoysly job args weren't applied so old
user defined workfunctions will raise a typeerror.
@wiwichips wiwichips changed the title feat(work_function)!: apply job args to workfn() Breaking API Change: Apply Job Args to User's Work Function Oct 15, 2024
Copy link
Member

@Xmader Xmader left a comment

Choose a reason for hiding this comment

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

LGTM

@wiwichips wiwichips merged commit b6d42e3 into main Oct 15, 2024
5 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