tft_beam.analyzer_cache.WriteAnalysisCacheToFS

Writes a cache object that can be read by ReadAnalysisCacheFromFS.

Given a cache collection, this writes it to the configured directory. If the configured directory already contains cache, this will merge the new cache with the old. NOTE: This merging of cache is determined at beam graph construction time, so the cache must already exist there when constructing this.

pipeline A beam Pipeline.
cache_base_dir A str, the path that the cache should be stored in.
dataset_keys (Optional) An iterable of strings.
sink (Optional) A PTransform class that takes a path in its constructor, and is used to write the cache. If not provided this uses a GZipped TFRecord sink.

label

Methods

annotations

default_label

default_type_hints

display_data

Returns the display data associated to a pipeline component.

It should be reimplemented in pipeline components that wish to have static display data.

Returns
Dict[str, Any]: A dictionary containing key:value pairs. The value might be an integer, float or string value; a :class:DisplayDataItem for values that have more data (e.g. short value, label, url); or a :class:HasDisplayData instance that has more display data that should be picked up. For example::

{ 'key1': 'string_value', 'key2': 1234, 'key3': 3.14159265, 'key4': DisplayDataItem('apache.org', url='http://apache.org'), 'key5': subComponent }

expand

View source

from_runner_api

get_resource_hints

get_type_hints

Gets and/or initializes type hints for this object.

If type hints have not been set, attempts to initialize type hints in this order:

  • Using self.default_type_hints().
  • Using self.class type hints.

get_windowing

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

By default most transforms just return the windowing function associated with the input PCollection (or the first input if several).

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 :class:PTransform with a type-hint.

Args
input_type_hint type

An instance of an allowed built-in type, a custom class, or an instance of a :class:~apache_beam.typehints.typehints.TypeConstraint.

Raises
TypeError If input_type_hint is not a valid type-hint. See :obj:apache_beam.typehints.typehints.validate_composite_type_param() for further details.

Returns
PTransform A reference to the instance of this particular :class:PTransform object. This allows chaining type-hinting related methods.

with_output_types

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

Args
type_hint type

An instance of an allowed built-in type, a custom class, or a :class:~apache_beam.typehints.typehints.TypeConstraint.

Raises
TypeError If type_hint is not a valid type-hint. See :obj:~apache_beam.typehints.typehints.validate_composite_type_param() for further details.

Returns
PTransform A reference to the instance of this particular :class:PTransform object. This allows chaining type-hinting related methods.

with_resource_hints

Adds resource hints to the :class:PTransform.

Resource hints allow users to express constraints on the environment where the transform should be executed. Interpretation of the resource hints is defined by Beam Runners. Runners may ignore the unsupported hints.

Args
**kwargs key-value pairs describing hints and their values.

Raises
ValueError if provided hints are unknown to the SDK. See :mod:apache_beam.transforms.resources for a list of known hints.

Returns
PTransform A reference to the instance of this particular :class:PTransform object.

__or__

Used to compose PTransforms, e.g., ptransform1 | ptransform2.

__ror__

Used to apply this PTransform to non-PValues, e.g., a tuple.

__rrshift__

pipeline None
side_inputs ()