Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove DataProcessor serialization workaround from VersionedDatasetBuilder #13

Open
kostaleonard opened this issue Dec 15, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@kostaleonard
Copy link
Owner

kostaleonard commented Dec 15, 2021

Pending a fix to uqfoundation/dill#424, remove workaround provided by pulumi/pulumi#7755. Offending code reproduced below:

def _serialize_data_processor(self) -> bytes:
    """Returns the serialized representation of the data processor object.

    :return: The serialized representation of the data processor object.
    """
    # See below dill issue on by-value serialization of classes not in
    # __main__:
    # https://github.com/uqfoundation/dill/issues/424
    # The current workaround is provided here:
    # https://github.com/pulumi/pulumi/pull/7755
    obj_type = type(self.data_processor)
    obj_module = obj_type.__module__
    try:
        obj_type.__module__ = '__main__'
        return pickle.dumps(self.data_processor, recurse=True)
    finally:
        obj_type.__module__ = obj_module
@kostaleonard kostaleonard added the enhancement New feature or request label Dec 15, 2021
@kostaleonard kostaleonard added this to the Second release milestone Dec 15, 2021
@kostaleonard kostaleonard self-assigned this Dec 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant