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 *args and **kwargs are accepted for API compatibility with ReadFromPubSub, but are ignored.

Methods

annotations

default_label

default_type_hints

display_data

Returns the display data associated to a pipeline component.

expand

Returns a PCollection created from self.messages list.

from_runner_api

get_resource_hints

get_type_hints

Gets and/or initializes type hints for this object.

get_windowing

Returns the window function to be associated with transform's output.

infer_output_type

register_urn

runner_api_requires_keyed_input

to_runner_api

to_runner_api_parameter

to_runner_api_pickled

type_check_inputs

type_check_inputs_or_outputs

type_check_outputs

with_input_types

Annotates the input type of a PTransform with a type-hint.

with_output_types

Annotates the output type of a PTransform with a type-hint.

with_resource_hints

Adds resource hints to the PTransform.

Attributes

label

pipeline

side_inputs

expand(pcoll)[source]#

Returns a PCollection created from self.messages list.

Return type:

PCollection