I read the Beam documentation and also looked at the Python documentation, but did not find a good explanation of the syntax used in most Apache Beam examples.
Can anyone explain what _ , | and >> in the code below? Also is there text in quotation marks, i.e. "ReadTrainingData", or can it be exchanged with any other shortcut? In other words, how is this label used?
train_data = pipeline | 'ReadTrainingData' >> _ReadData(training_data) evaluate_data = pipeline | 'ReadEvalData' >> _ReadData(eval_data) input_metadata = dataset_metadata.DatasetMetadata(schema=input_schema) _ = (input_metadata | 'WriteInputMetadata' >> tft_beam_io.WriteMetadata( os.path.join(output_dir, path_constants.RAW_METADATA_DIR), pipeline=pipeline)) preprocessing_fn = reddit.make_preprocessing_fn(frequency_threshold) (train_dataset, train_metadata), transform_fn = ( (train_data, input_metadata) | 'AnalyzeAndTransform' >> tft.AnalyzeAndTransformDataset( preprocessing_fn))
python apache-beam
dobbysock1002
source share