apache_beam.transforms.environments module

Environments concepts.

For internal use only. No backwards compatibility guarantees.

class apache_beam.transforms.environments.Environment(capabilities: Iterable[str] = (), artifacts: Iterable[ArtifactInformation] = (), resource_hints: Mapping[str, bytes] | None = None)[source]

Bases: object

Abstract base class for environments.

Represents a type and configuration of environment. Each type of Environment should have a unique urn.

For internal use only. No backwards compatibility guarantees.

artifacts() Iterable[ArtifactInformation][source]
to_runner_api_parameter(context: PipelineContext) Tuple[str, message.Message | bytes | str | None][source]
capabilities() Iterable[str][source]
resource_hints() Mapping[str, bytes][source]
classmethod register_urn(urn, parameter_type)[source]
classmethod register_urn(urn, parameter_type)
classmethod register_urn(urn, parameter_type, constructor)
classmethod register_urn(urn, parameter_type, constructor)
classmethod get_env_cls_from_urn(urn: str) Type[Environment][source]
to_runner_api(context: PipelineContext) beam_runner_api_pb2.Environment[source]
classmethod from_runner_api(proto: beam_runner_api_pb2.Environment | None, context: PipelineContext) Environment | None[source]
classmethod from_options(options: Type[EnvironmentT]) EnvironmentT[source]

Creates an Environment object from PortableOptions.

Parameters:

options – The PortableOptions object.

class apache_beam.transforms.environments.AnyOfEnvironment(environments)[source]

Bases: Environment

to_runner_api_parameter(context: PipelineContext) Tuple[str, beam_runner_api_pb2.AnyOfEnvironmentPayload][source]
static from_runner_api_parameter(payload: beam_runner_api_pb2.AnyOfEnvironmentPayload, capabilities: Iterable[str], artifacts: Iterable[beam_runner_api_pb2.ArtifactInformation], resource_hints: Mapping[str, bytes], context: PipelineContext) AnyOfEnvironment[source]
static create_proto(environments: Iterable[Environment]) Environment[source]
class apache_beam.transforms.environments.DefaultEnvironment(capabilities: Iterable[str] = (), artifacts: Iterable[ArtifactInformation] = (), resource_hints: Mapping[str, bytes] | None = None)[source]

Bases: Environment

Used as a stub when context is missing a default environment.

to_runner_api_parameter(context)[source]
static from_runner_api_parameter(payload: beam_runner_api_pb2.DockerPayload, capabilities: Iterable[str], artifacts: Iterable[beam_runner_api_pb2.ArtifactInformation], resource_hints: Mapping[str, bytes], context: PipelineContext) DefaultEnvironment[source]
class apache_beam.transforms.environments.DockerEnvironment(container_image=None, capabilities=(), artifacts=(), resource_hints=None)[source]

Bases: Environment

to_runner_api_parameter(context: PipelineContext) Tuple[str, beam_runner_api_pb2.DockerPayload][source]
static from_runner_api_parameter(payload: beam_runner_api_pb2.DockerPayload, capabilities: Iterable[str], artifacts: Iterable[beam_runner_api_pb2.ArtifactInformation], resource_hints: Mapping[str, bytes], context: PipelineContext) DockerEnvironment[source]
classmethod from_options(options: PortableOptions) DockerEnvironment[source]
classmethod from_container_image(container_image: str, artifacts: Iterable[ArtifactInformation] = (), resource_hints: Mapping[str, bytes] | None = None) DockerEnvironment[source]
static default_docker_image() str[source]
class apache_beam.transforms.environments.ProcessEnvironment(command: str, os: str = '', arch: str = '', env: Mapping[str, str] | None = None, capabilities: Iterable[str] = (), artifacts: Iterable[ArtifactInformation] = (), resource_hints: Mapping[str, bytes] | None = None)[source]

Bases: Environment

to_runner_api_parameter(context: PipelineContext) Tuple[str, beam_runner_api_pb2.ProcessPayload][source]
static from_runner_api_parameter(payload, capabilities: Iterable[str], artifacts: Iterable[beam_runner_api_pb2.ArtifactInformation], resource_hints: Mapping[str, bytes], context: PipelineContext) ProcessEnvironment[source]
static parse_environment_variables(variables)[source]
classmethod from_options(options: PortableOptions) ProcessEnvironment[source]
class apache_beam.transforms.environments.ExternalEnvironment(url, params=None, capabilities=(), artifacts=(), resource_hints=None)[source]

Bases: Environment

to_runner_api_parameter(context: PipelineContext) Tuple[str, beam_runner_api_pb2.ExternalPayload][source]
static from_runner_api_parameter(payload: beam_runner_api_pb2.ExternalPayload, capabilities: Iterable[str], artifacts: Iterable[beam_runner_api_pb2.ArtifactInformation], resource_hints: Mapping[str, bytes], context: PipelineContext) ExternalEnvironment[source]
classmethod from_options(options: PortableOptions) ExternalEnvironment[source]
class apache_beam.transforms.environments.EmbeddedPythonEnvironment(capabilities: Iterable[str] = (), artifacts: Iterable[ArtifactInformation] = (), resource_hints: Mapping[str, bytes] | None = None)[source]

Bases: Environment

to_runner_api_parameter(context: PipelineContext) Tuple[str, None][source]
static from_runner_api_parameter(unused_payload: None, capabilities: Iterable[str], artifacts: Iterable[beam_runner_api_pb2.ArtifactInformation], resource_hints: Mapping[str, bytes], context: PipelineContext) EmbeddedPythonEnvironment[source]
classmethod from_options(options: PortableOptions) EmbeddedPythonEnvironment[source]
classmethod default() EmbeddedPythonEnvironment[source]
class apache_beam.transforms.environments.EmbeddedPythonGrpcEnvironment(state_cache_size=None, data_buffer_time_limit_ms=None, capabilities=(), artifacts=(), resource_hints=None)[source]

Bases: Environment

to_runner_api_parameter(context: PipelineContext) Tuple[str, bytes][source]
static from_runner_api_parameter(payload: bytes, capabilities: Iterable[str], artifacts: Iterable[beam_runner_api_pb2.ArtifactInformation], resource_hints: Mapping[str, bytes], context: PipelineContext) EmbeddedPythonGrpcEnvironment[source]
classmethod from_options(options: PortableOptions) EmbeddedPythonGrpcEnvironment[source]
static parse_config(s: str) Dict[str, Any][source]
classmethod default() EmbeddedPythonGrpcEnvironment[source]
class apache_beam.transforms.environments.SubprocessSDKEnvironment(command_string, capabilities=(), artifacts=(), resource_hints=None)[source]

Bases: Environment

to_runner_api_parameter(context: PipelineContext) Tuple[str, bytes][source]
static from_runner_api_parameter(payload: bytes, capabilities: Iterable[str], artifacts: Iterable[beam_runner_api_pb2.ArtifactInformation], resource_hints: Mapping[str, bytes], context: PipelineContext) SubprocessSDKEnvironment[source]
classmethod from_options(options: PortableOptions) SubprocessSDKEnvironment[source]
classmethod from_command_string(command_string: str) SubprocessSDKEnvironment[source]
class apache_beam.transforms.environments.PyPIArtifactRegistry[source]

Bases: object

classmethod register_artifact(name, version)[source]
classmethod get_artifacts()[source]