apache_beam.options.value_provider module

A ValueProvider abstracts the notion of fetching a value that may or may not be currently available.

This can be used to parameterize transforms that only read values in at runtime, for example.

class apache_beam.options.value_provider.ValueProvider[source]

Bases: object

Base class that all other ValueProviders must implement.

is_accessible()[source]

Whether the contents of this ValueProvider is available to routines that run at graph construction time.

get()[source]

Return the value wrapped by this ValueProvider.

class apache_beam.options.value_provider.StaticValueProvider(value_type, value)[source]

Bases: ValueProvider

StaticValueProvider is an implementation of ValueProvider that allows for a static value to be provided.

Parameters:
  • value_type – Type of the static value

  • value – Static value

is_accessible()[source]
get()[source]
class apache_beam.options.value_provider.RuntimeValueProvider(option_name, value_type, default_value)[source]

Bases: ValueProvider

RuntimeValueProvider is an implementation of ValueProvider that allows for a value to be provided at execution time rather than at graph construction time.

runtime_options = None
experiments: Set[str] = {}
is_accessible()[source]
classmethod get_value(option_name, value_type, default_value)[source]
get()[source]
classmethod set_runtime_options(pipeline_options)[source]
class apache_beam.options.value_provider.NestedValueProvider(value, translator)[source]

Bases: ValueProvider

NestedValueProvider is an implementation of ValueProvider that allows for wrapping another ValueProvider object.

Creates a NestedValueProvider that wraps the provided ValueProvider.

Parameters:
  • value – ValueProvider object to wrap

  • translator – function that is applied to the ValueProvider

Raises:

RuntimeValueProviderError – if any of the provided objects are not accessible.

is_accessible()[source]
get()[source]
apache_beam.options.value_provider.check_accessible(value_provider_list)[source]

A decorator that checks accessibility of a list of ValueProvider objects.

Parameters:

value_provider_list – list of ValueProvider objects

Raises:

RuntimeValueProviderError – if any of the provided objects are not accessible.