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

Add the possibility to give environment variables to dask client in 'dask.get_or_create_dask_client' #31

Open
remi-braun opened this issue Dec 12, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@remi-braun
Copy link
Member

remi-braun commented Dec 12, 2024

See https://jacobtomlinson.dev/posts/2022/how-to-set-environment-variables-on-your-dask-workers/

Currently we have to do:

def set_env():
    os.environ["ENV_VAR"] = "1"

with dask.get_or_create_dask_client(processes=False) as client:
    client.run(set_env)
    function(*args, **kwargs)

Goal is to do:

with dask.get_or_create_dask_client(env_vars={"ENV_VAR": "1"}) as client:
    client.run(set_env)
    function(*args, **kwargs)
@remi-braun remi-braun added the enhancement New feature or request label Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant