def _init_app( app: FastAPI, context: dask_sql.Context = None, client: dask.distributed.Client = None, ): app.c = context or Context() app.future_list = {} app.client = client or dask.distributed.Client()
def _init_app( app: FastAPI, context: Context = None, client: dask.distributed.Client = None, ): app.c = context or Context() app.future_list = {} try: client = client or dask.distributed.Client.current() except ValueError: client = dask.distributed.Client() app.client = client