riteshghorse commented on code in PR #30001:
URL: https://github.com/apache/beam/pull/30001#discussion_r1456508147


##########
sdks/python/apache_beam/transforms/enrichment_handlers/bigtable.py:
##########
@@ -42,22 +59,30 @@ class EnrichWithBigTable(EnrichmentSourceHandler[beam.Row, 
beam.Row]):
     project_id (str): GCP project-id of the BigTable cluster.
     instance_id (str): GCP instance-id of the BigTable cluster.
     table_id (str): GCP table-id of the BigTable.
-    row_key (str): unique row key for BigTable
+    row_key (str): unique row-key field name from the input `beam.Row` object
+      to use as `row_key` for BigTable querying.
     row_filter: a ``:class:`google.cloud.bigtable.row_filters.RowFilter``` to
       filter data read with ``read_row()``.
+    exception_level: a `enum.Enum` value from
+      ``apache_beam.transforms.enrichment_handlers.bigtable.ExceptionLevel``
+      to set the level when an empty row is returned from the BigTable query.
+      Defaults to ``ExceptionLevel.QUIET``.
   """
   def __init__(
       self,
       project_id: str,
       instance_id: str,
       table_id: str,
       row_key: str,
-      row_filter: Optional[RowFilter] = None):
+      row_filter: Optional[RowFilter] = None,
+      exception_level: ExceptionLevel = ExceptionLevel.QUIET,

Review Comment:
   Done!



##########
sdks/python/apache_beam/transforms/enrichment_handlers/bigtable.py:
##########
@@ -28,11 +29,27 @@
 
 __all__ = [
     'EnrichWithBigTable',
+    'ExceptionLevel',
 ]
 
 _LOGGER = logging.getLogger(__name__)
 
 
+class ExceptionLevel(Enum):
+  """ExceptionLevel defines the exception level options to either
+  log a warning, or raise an exception, or do nothing when a BigTable query
+  returns an empty row.
+
+  Members:
+    - WARNING_ONLY: Log a warning for exception without raising it.
+    - RAISE: Raise the exception.
+    - QUIET: Neither log nor raise the exception.
+  """
+  WARNING_ONLY = 0
+  RAISE = 1

Review Comment:
   Sounds good!



-- 
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]

Reply via email to