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.
- 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
- 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
- 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.
- 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.