Skip to main content

message_service

Interface classes and methods for the message service.

Provides functionality to wrap generated GRPC code and python-friendly versions of GRPC classes and methods.

Module​

Functions​

message_metadata_from_grpc_2_sdk​

def message_metadata_from_grpc_2_sdk(    grpc_message_metadata: GrpcMessageMetadata,) ‑> bitfount.federated.transport.message_service._MessageMetadata:

Deserialise message metadata.

message_metadata_from_sdk_2_grpc​

def message_metadata_from_sdk_2_grpc(    message_metadata: _MessageMetadata,) ‑> MessageMetadata:

Serialise message metadata.

message_multipart_upload_metadata_from_grpc_2_sdk​

def message_multipart_upload_metadata_from_grpc_2_sdk(    grpc_multipart_upload_metadata: GrpcMultipartUploadMetadata,) ‑> bitfount.federated.transport.message_service._MultipartUploadMetadata:

Deserialise multipart upload metadata.

message_multipart_upload_metadata_from_sdk_2_grpc​

def message_multipart_upload_metadata_from_sdk_2_grpc(    multipart_upload_metadata: _MultipartUploadMetadata,) ‑> MultipartUploadMetadata:

Serialise multipart upload metadata.

msgpackext_decode​

def msgpackext_decode(code: int, obj: Any) ‑> Any:

Extension to deserialise DataFrame and numpy using arrow.

Arguments

  • code: An integer specifying whether the object is a numpy array (code=1) or Dataframe (code=2).
  • obj: An encoded object, likely a dictionary.

Returns The decoded form of the object.

msgpackext_encode​

def msgpackext_encode(obj: Any) ‑> Any:

Serialises extension objects for DataFrames or np.ndarray using pyarrow.

Arguments

  • obj: An object to be serialized

Returns A msgpack compatible extension form of the object.

Classes​

ResourceConsumed​

class ResourceConsumed(    resource_type: ResourceType, resource_identifier: str, amount: float,):

Resource consumed during the execution of an algorithm or task step.

Variables​

  • static amount : float
  • static resource_identifier : str

ResourceType​

class ResourceType(*args, **kwds):

Type of resource consumed.

Ancestors​

Variables​

  • static MODEL_INFERENCE

TaskNotification​

class TaskNotification(message: str, email: bool):

User-readable notification that should be triggered by this message.

Variables​

  • static email : bool
  • static message : str