Skip to content

Pickling Annotations can _still_ fail #209

Description

@jamesstidard

I'm getting some strange behaviour related to #193. Sorry to open the typing can of worms.

I'm using Python 3.7 and cloudpickle==0.5.6 but have been using cloudpickle via distributed==1.23.2. Which I reported over at: dask/distributed#2291

The above code sample works for me. However, the following does not:

fromtypingimportOptionalfromdistributedimportClientdeff2() ->Optional[int]:
return1deff1() ->int:
return1defmain():
client=Client()
print(client.submit(f1).result()) # works. prints 1print(client.submit(f2).result()) # fail. raisesclient.close()
if__name__=='__main__':
main()

Apologies that this includes a dask dependency. I tried to reproduce with the above code snippet but I don't get an exception:

fromtypingimportOptionalimportcloudpicklecloudpickle.dumps(Optional[int], protocol=cloudpickle.DEFAULT_PROTOCOL)

I'm a little bemused to where the problem is coming from now with those results.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions