Example #1
0
    def _write_protobuf(self, profile: DatasetProfile):
        """
        Write a protobuf serialization of the DatasetProfile to disk
        """
        path = self.ensure_path(os.path.join(self.path_suffix(profile), "protobuf"))

        protobuf: Message = profile.to_protobuf()

        with open(os.path.join(path, self.file_name(profile, ".bin")), "wb") as f:
            f.write(protobuf.SerializeToString())
Example #2
0
    def _write_protobuf(self, profile: DatasetProfile):
        """
        Write a datasetprofile protobuf serialization to S3
        """
        path = os.path.join(self.output_path, self.path_suffix(profile), "protobuf")

        protobuf: Message = profile.to_protobuf()

        with self.fs.open(
            os.path.join(path, self.file_name(profile, ".bin")), "wb"
        ) as f:
            f.write(protobuf.SerializeToString())