graphql-sync-dataloaders icon indicating copy to clipboard operation
graphql-sync-dataloaders copied to clipboard

fix: future

Open superlevure opened this issue 1 year ago • 2 comments

superlevure avatar Jul 07 '23 16:07 superlevure

I'm not related to author of the PR, but we noticed the following error due to this issue:

NameError: free variable 'future' referenced before assignment in enclosing scope
  File "graphql_sync_dataloaders/execution_context.py", line 156, in process_completed
    future.set_result(completed.result())
  File "graphql_sync_dataloaders/sync_future.py", line 53, in set_result
    self._finish()
  File "graphql_sync_dataloaders/sync_future.py", line 73, in _finish
    callback(self._result)
  File "graphql_sync_dataloaders/execution_context.py", line 100, in process_result
    future.set_result(results)

free variable 'future' referenced before assignment in enclosing scope

tonysyu avatar Sep 12 '23 15:09 tonysyu

We've created a fork of this repo with the above fix if you're interested: https://github.com/loft-orbital/graphql-sync-dataloaders/tree/loft-main

We've been running dataloaders in productions for a few weeks now without any significant issues, we're planning on pushing a PR on graphene-django to support them automatically

superlevure avatar Sep 12 '23 15:09 superlevure