Skip to content

Recent release brings in all globals #202

Description

@mrocklin

The following test started to fail in the latest 0.5.6 release:

importnumpyasnpimportcloudpickledeftest_pickle_globals():
deff(x):
returnnp.sin(x) +np.cos(x) # requires access to global numpydefg(): # some other object not necessary for fpassd=cloudpickle.loads(cloudpickle.dumps(f)).__globals__assert'g'notindassertset(d) == {'np', '__builtins__'}

It now seems that cloudpickle brings in many more globals into the serialization.

In [6]: set(d)
Out[6]: {'In',
'Out',
'_',
'_5',
'__',
'___',
'__builtin__',
'__builtins__',
'__doc__',
'__loader__',
'__name__',
'__package__',
'__spec__',
'_dh',
'_i',
'_i1',
'_i2',
'_i3',
'_i4',
'_i5',
'_i6',
'_ih',
'_ii',
'_iii',
'_oh',
'cloudpickle',
'd',
'exit',
'f',
'g',
'get_ipython',
'np',
'quit'}

This is causing dask tests to fail

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

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions