rszper commented on code in PR #30692: URL: https://github.com/apache/beam/pull/30692#discussion_r1539785416
########## website/www/site/content/en/documentation/transforms/python/elementwise/enrichment-vertexai.md: ########## @@ -0,0 +1,89 @@ +--- +title: "Enrichment with Vertex AI Feature Store" +--- +<!-- +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +--> + +# Enrichment with Google Cloud Vertex AI Feature Store + +{{< localstorage language language-py >}} + +<table> + <tr> + <td> + <a> + {{< button-pydoc path="apache_beam.transforms.enrichment_handlers.vertex_ai_feature_store" class="VertexAIFeatureStoreEnrichmentHandler" >}} + </a> + </td> + </tr> +</table> + + +In Apache Beam 2.55.0 and later versions, the enrichment transform includes a built-in enrichment handler for [Vertex AI Feature Store](https://cloud.google.com/vertex-ai/docs/featurestore). +The following example demonstrates how to create a pipeline that use the enrichment transform with [`VertexAIFeatureStoreEnrichmentHandler`](https://beam.apache.org/releases/pydoc/current/apache_beam.transforms.enrichment_handlers.vertex_ai_feature_store.html#apache_beam.transforms.enrichment_handlers.vertex_ai_feature_store.VertexAIFeatureStoreEnrichmentHandler) and [`VertexAIFeatureStoreLegacyEnrichmentHandler`](https://beam.apache.org/releases/pydoc/current/apache_beam.transforms.enrichment_handlers.vertex_ai_feature_store.html#apache_beam.transforms.enrichment_handlers.vertex_ai_feature_store.VertexAIFeatureStoreLegacyEnrichmentHandler). + +## Example 1: Enrichment with Vertex AI Feature Store + +The precomputed feature values stored in Vertex AI Feature Store uses the following format. + +{{< table >}} +| user_id | age | gender | state | country | +|:--------:|:----:|:-------:|:-----:|:-------:| +| 21422 | 12 | 0 | 0 | 0 | +| 2963 | 12 | 1 | 1 | 1 | +| 20592 | 12 | 1 | 2 | 2 | +| 76538 | 12 | 1 | 3 | 0 | +{{< /table >}} + + +{{< highlight language="py" >}} +{{< code_sample "sdks/python/apache_beam/examples/snippets/transforms/elementwise/enrichment.py" enrichment_with_vertex_ai >}} +{{</ highlight >}} + +{{< paragraph class="notebook-skip" >}} +Output: +{{< /paragraph >}} +{{< highlight class="notebook-skip" >}} +{{< code_sample "sdks/python/apache_beam/examples/snippets/transforms/elementwise/enrichment_test.py" enrichment_with_vertex_ai >}} +{{< /highlight >}} + +## Example 2: Enrichment with Vertex AI Feature Store (Legacy) Review Comment: ```suggestion ## Example 2: Enrichment with Vertex AI Feature Store (legacy) ``` ########## website/www/site/content/en/documentation/transforms/python/elementwise/enrichment-bigtable.md: ########## @@ -0,0 +1,62 @@ +--- +title: "Enrichment with Bigtable" +--- +<!-- +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +--> + +# Use Bigtable to enrich data + +{{< localstorage language language-py >}} + +<table> + <tr> + <td> + <a> + {{< button-pydoc path="apache_beam.transforms.enrichment_handlers.bigtable" class="BigTableEnrichmentHandler" >}} + </a> + </td> + </tr> +</table> + +In Apache Beam 2.54.0 and later versions, the enrichment transform includes a built-in enrichment handler for [Bigtable](https://cloud.google.com/bigtable/docs/overview). +The following example demonstrates how to create a pipeline that use the enrichment transform with [`BigTableEnrichmentHandler`](https://beam.apache.org/releases/pydoc/current/apache_beam.transforms.enrichment_handlers.bigtable.html#apache_beam.transforms.enrichment_handlers.bigtable.BigTableEnrichmentHandler). Review Comment: ```suggestion The following example demonstrates how to create a pipeline that use the enrichment transform with the [`BigTableEnrichmentHandler`](https://beam.apache.org/releases/pydoc/current/apache_beam.transforms.enrichment_handlers.bigtable.html#apache_beam.transforms.enrichment_handlers.bigtable.BigTableEnrichmentHandler) handler. ``` ########## website/www/site/content/en/documentation/transforms/python/elementwise/enrichment-vertexai.md: ########## @@ -0,0 +1,89 @@ +--- +title: "Enrichment with Vertex AI Feature Store" +--- +<!-- +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +--> + +# Enrichment with Google Cloud Vertex AI Feature Store + +{{< localstorage language language-py >}} + +<table> + <tr> + <td> + <a> + {{< button-pydoc path="apache_beam.transforms.enrichment_handlers.vertex_ai_feature_store" class="VertexAIFeatureStoreEnrichmentHandler" >}} + </a> + </td> + </tr> +</table> + + +In Apache Beam 2.55.0 and later versions, the enrichment transform includes a built-in enrichment handler for [Vertex AI Feature Store](https://cloud.google.com/vertex-ai/docs/featurestore). +The following example demonstrates how to create a pipeline that use the enrichment transform with [`VertexAIFeatureStoreEnrichmentHandler`](https://beam.apache.org/releases/pydoc/current/apache_beam.transforms.enrichment_handlers.vertex_ai_feature_store.html#apache_beam.transforms.enrichment_handlers.vertex_ai_feature_store.VertexAIFeatureStoreEnrichmentHandler) and [`VertexAIFeatureStoreLegacyEnrichmentHandler`](https://beam.apache.org/releases/pydoc/current/apache_beam.transforms.enrichment_handlers.vertex_ai_feature_store.html#apache_beam.transforms.enrichment_handlers.vertex_ai_feature_store.VertexAIFeatureStoreLegacyEnrichmentHandler). Review Comment: ```suggestion The following example demonstrates how to create a pipeline that use the enrichment transform with the [`VertexAIFeatureStoreEnrichmentHandler`](https://beam.apache.org/releases/pydoc/current/apache_beam.transforms.enrichment_handlers.vertex_ai_feature_store.html#apache_beam.transforms.enrichment_handlers.vertex_ai_feature_store.VertexAIFeatureStoreEnrichmentHandler) handler and the [`VertexAIFeatureStoreLegacyEnrichmentHandler`](https://beam.apache.org/releases/pydoc/current/apache_beam.transforms.enrichment_handlers.vertex_ai_feature_store.html#apache_beam.transforms.enrichment_handlers.vertex_ai_feature_store.VertexAIFeatureStoreLegacyEnrichmentHandler) handler. ``` ########## website/www/site/content/en/documentation/transforms/python/elementwise/enrichment-vertexai.md: ########## @@ -0,0 +1,89 @@ +--- +title: "Enrichment with Vertex AI Feature Store" +--- +<!-- +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +--> + +# Enrichment with Google Cloud Vertex AI Feature Store + +{{< localstorage language language-py >}} + +<table> + <tr> + <td> + <a> + {{< button-pydoc path="apache_beam.transforms.enrichment_handlers.vertex_ai_feature_store" class="VertexAIFeatureStoreEnrichmentHandler" >}} + </a> + </td> + </tr> +</table> + + +In Apache Beam 2.55.0 and later versions, the enrichment transform includes a built-in enrichment handler for [Vertex AI Feature Store](https://cloud.google.com/vertex-ai/docs/featurestore). +The following example demonstrates how to create a pipeline that use the enrichment transform with [`VertexAIFeatureStoreEnrichmentHandler`](https://beam.apache.org/releases/pydoc/current/apache_beam.transforms.enrichment_handlers.vertex_ai_feature_store.html#apache_beam.transforms.enrichment_handlers.vertex_ai_feature_store.VertexAIFeatureStoreEnrichmentHandler) and [`VertexAIFeatureStoreLegacyEnrichmentHandler`](https://beam.apache.org/releases/pydoc/current/apache_beam.transforms.enrichment_handlers.vertex_ai_feature_store.html#apache_beam.transforms.enrichment_handlers.vertex_ai_feature_store.VertexAIFeatureStoreLegacyEnrichmentHandler). + +## Example 1: Enrichment with Vertex AI Feature Store + +The precomputed feature values stored in Vertex AI Feature Store uses the following format. Review Comment: ```suggestion The precomputed feature values stored in Vertex AI Feature Store uses the following format: ``` ########## website/www/site/content/en/documentation/transforms/python/elementwise/enrichment.md: ########## @@ -32,35 +32,22 @@ limitations under the License. The enrichment transform lets you dynamically enrich data in a pipeline by doing a key-value lookup to a remote service. The transform uses [`RequestResponeIO`](https://beam.apache.org/releases/pydoc/current/apache_beam.io.requestresponseio.html#apache_beam.io.requestresponseio.RequestResponseIO) internally. This feature uses client-side throttling to ensure that the remote service isn't overloaded with requests. If service-side errors occur, like `TooManyRequests` and `Timeout` exceptions, it retries the requests by using exponential backoff. -In Apache Beam 2.54.0 and later versions, the transform includes a built-in enrichment handler for [Bigtable](https://cloud.google.com/bigtable/docs/overview). +This transform is available in Apache Beam 2.54.0 and later versions. -## Use Bigtable to enrich data +## Examples -The following example demonstrates how to create a pipeline that use the enrichment transform with [`BigTableEnrichmentHandler`](https://beam.apache.org/releases/pydoc/current/apache_beam.transforms.enrichment_handlers.bigtable.html#apache_beam.transforms.enrichment_handlers.bigtable.BigTableEnrichmentHandler). +The following examples demonstrates how to create a pipeline that use the enrichment transform to enrich data from external services. Review Comment: ```suggestion The following examples demonstrate how to create a pipeline that use the enrichment transform to enrich data from external services. ``` ########## website/www/site/content/en/documentation/transforms/python/elementwise/enrichment-vertexai.md: ########## @@ -0,0 +1,89 @@ +--- +title: "Enrichment with Vertex AI Feature Store" +--- +<!-- +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +--> + +# Enrichment with Google Cloud Vertex AI Feature Store + +{{< localstorage language language-py >}} + +<table> + <tr> + <td> + <a> + {{< button-pydoc path="apache_beam.transforms.enrichment_handlers.vertex_ai_feature_store" class="VertexAIFeatureStoreEnrichmentHandler" >}} + </a> + </td> + </tr> +</table> + + +In Apache Beam 2.55.0 and later versions, the enrichment transform includes a built-in enrichment handler for [Vertex AI Feature Store](https://cloud.google.com/vertex-ai/docs/featurestore). +The following example demonstrates how to create a pipeline that use the enrichment transform with [`VertexAIFeatureStoreEnrichmentHandler`](https://beam.apache.org/releases/pydoc/current/apache_beam.transforms.enrichment_handlers.vertex_ai_feature_store.html#apache_beam.transforms.enrichment_handlers.vertex_ai_feature_store.VertexAIFeatureStoreEnrichmentHandler) and [`VertexAIFeatureStoreLegacyEnrichmentHandler`](https://beam.apache.org/releases/pydoc/current/apache_beam.transforms.enrichment_handlers.vertex_ai_feature_store.html#apache_beam.transforms.enrichment_handlers.vertex_ai_feature_store.VertexAIFeatureStoreLegacyEnrichmentHandler). + +## Example 1: Enrichment with Vertex AI Feature Store + +The precomputed feature values stored in Vertex AI Feature Store uses the following format. + +{{< table >}} +| user_id | age | gender | state | country | +|:--------:|:----:|:-------:|:-----:|:-------:| +| 21422 | 12 | 0 | 0 | 0 | +| 2963 | 12 | 1 | 1 | 1 | +| 20592 | 12 | 1 | 2 | 2 | +| 76538 | 12 | 1 | 3 | 0 | +{{< /table >}} + + +{{< highlight language="py" >}} +{{< code_sample "sdks/python/apache_beam/examples/snippets/transforms/elementwise/enrichment.py" enrichment_with_vertex_ai >}} +{{</ highlight >}} + +{{< paragraph class="notebook-skip" >}} +Output: +{{< /paragraph >}} +{{< highlight class="notebook-skip" >}} +{{< code_sample "sdks/python/apache_beam/examples/snippets/transforms/elementwise/enrichment_test.py" enrichment_with_vertex_ai >}} +{{< /highlight >}} + +## Example 2: Enrichment with Vertex AI Feature Store (Legacy) + +The precomputed feature values stored in Vertex AI Feature Store (Legacy) uses the following format: Review Comment: ```suggestion The precomputed feature values stored in Vertex AI Feature Store (Legacy) use the following format: ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
