From fa9eb2fe17f5f96b40275fe7b0a3981f4a52e0df Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Fri, 18 Oct 2024 11:15:02 -0400 Subject: [PATCH] Enrichment pydoc improvements (#32861) --- .../apache_beam/yaml/yaml_enrichment.py | 62 +++++++------------ 1 file changed, 21 insertions(+), 41 deletions(-) diff --git a/sdks/python/apache_beam/yaml/yaml_enrichment.py b/sdks/python/apache_beam/yaml/yaml_enrichment.py index 00f2a5c1b1d1..9bea17f78fdd 100644 --- a/sdks/python/apache_beam/yaml/yaml_enrichment.py +++ b/sdks/python/apache_beam/yaml/yaml_enrichment.py @@ -48,7 +48,19 @@ def enrichment_transform( """ The Enrichment transform allows you to dynamically enhance elements in a pipeline by performing key-value - lookups against external services like APIs or databases. + lookups against external services like APIs or databases. + + Example Usage:: + + - type: Enrichment + config: + enrichment_handler: 'BigTable' + handler_config: + project_id: 'apache-beam-testing' + instance_id: 'beam-test' + table_id: 'bigtable-enrichment-test' + row_key: 'product_id' + timeout: 30 Args: enrichment_handler: Specifies the source from @@ -58,46 +70,14 @@ def enrichment_transform( "BigTable", "FeastFeatureStore", "VertexAIFeatureStore"]. handler_config: Specifies the parameters for - the respective enrichment_handler in a dictionary format. - BigQuery = ( - "BigQuery: " - "project, table_name, row_restriction_template, " - "fields, column_names, "condition_value_fn, " - "query_fn, min_batch_size, max_batch_size" - ) - - BigTable = ( - "BigTable: " - "project_id, instance_id, table_id, " - "row_key, row_filter, app_profile_id, " - "encoding, ow_key_fn, exception_level, include_timestamp" - ) - - FeastFeatureStore = ( - "FeastFeatureStore: " - "feature_store_yaml_path, feature_names, " - "feature_service_name, full_feature_names, " - "entity_row_fn, exception_level" - ) - - VertexAIFeatureStore = ( - "VertexAIFeatureStore: " - "project, location, api_endpoint, feature_store_name, " - "feature_view_name, row_key, exception_level" - ) - - Example Usage: - - - type: Enrichment - config: - enrichment_handler: 'BigTable' - handler_config: - project_id: 'apache-beam-testing' - instance_id: 'beam-test' - table_id: 'bigtable-enrichment-test' - row_key: 'product_id' - timeout: 30 - + the respective enrichment_handler in a dictionary format. + To see the full set of handler_config parameters, see + their corresponding doc pages: + + - :class:`~apache_beam.transforms.enrichment_handlers.bigquery.BigQueryEnrichmentHandler` # pylint: disable=line-too-long + - :class:`~apache_beam.transforms.enrichment_handlers.bigtable.BigTableEnrichmentHandler` # pylint: disable=line-too-long + - :class:`~apache_beam.transforms.enrichment_handlers.feast_feature_store.FeastFeatureStoreEnrichmentHandler` # pylint: disable=line-too-long + - :class:`~apache_beam.transforms.enrichment_handlers.vertex_ai_feature_store.VertexAIFeatureStoreEnrichmentHandler` # pylint: disable=line-too-long """ options.YamlOptions.check_enabled(pcoll.pipeline, 'Enrichment')