Skip to content

cloudpickle is not stable in notebooks #538

Open
@shobsi

Description

@shobsi

Consider this code in a colab notebook cell:

import cloudpickle

MY_PI = 3.1415

def get_pi():
  return MY_PI

print(cloudpickle.dumps(get_pi))

every time I rerun this cell I get a different output. This is unlike a Python script where it gives a consistent output. I am trying to use cloudpickle to capture the function and persist it in a storage for later use. I want to update the storage only when there is a material change in the behavior of the function, but because of this behavior in the notebook I am running into redundant updates of the storage which is costly. Is there a way I can avoid this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions