Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enrichment pydoc improvements #32861

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 21 additions & 41 deletions sdks/python/apache_beam/yaml/yaml_enrichment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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')

Expand Down
Loading