gfw.common.beam.transforms.FakeReadFromPubSub#
- class FakeReadFromPubSub(*args, messages=None, **kwargs)[source]#
A fake ReadFromPubSub to simulate Pub/Sub messages in tests.
- Parameters:
messages (list[dict] | None) – A list of dictionaries representing Pub/Sub messages. Each dictionary is passed as keyword arguments to
apache_beam.io.gcp.pubsub.PubsubMessage.
Note
Any additional
*argsand**kwargsare accepted for API compatibility withReadFromPubSub, but are ignored.Methods
annotationsdefault_labeldefault_type_hintsReturns the display data associated to a pipeline component.
Returns a PCollection created from self.messages list.
from_runner_apiget_resource_hintsGets and/or initializes type hints for this object.
Returns the window function to be associated with transform's output.
infer_output_typeregister_urnrunner_api_requires_keyed_inputto_runner_apito_runner_api_parameterto_runner_api_pickledtype_check_inputstype_check_inputs_or_outputstype_check_outputsAnnotates the input type of a
PTransformwith a type-hint.Annotates the output type of a
PTransformwith a type-hint.Adds resource hints to the
PTransform.Attributes
labelpipelineside_inputs