Skip to content

Calling cluster_view from within another python file #48

@GarrettBeatty

Description

@GarrettBeatty

If I have the following code:

def run():
    with cluster_view(scheduler=None, queue=None, num_jobs=5, direct=True,
                    extra_params={"run_local": True}) as view:
        a = 1
        view.push({'a':a})
        test = view.map(some_function, range(20))

When I call run from within another Python file I get an error.. NameError: name 'a' is not defined.
This code will work if I just call run() within the same file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions