shikhabhadoria opened a new pull request, #41698:
URL: https://github.com/apache/beam/pull/41698

   ## Purpose
   
   Fixes #41346.
   
   `BigTableEnrichmentHandler` had two bugs when resolving `row_key`:
   
   1. A `None` join key was coerced with `str(None)` to `None`, so Bigtable was 
queried for literal `b'None'`.
   2. A missing `row_key` field raised `KeyError` with a blank name because the 
handler interpolated the unset `row_key_str` instead of `self._row_key`.
   
   ## Changes
   
   - Treat `None` lookup values like an empty enrichment result and honor 
`ExceptionLevel` (`WARN` / `RAISE` / `QUIET`) without calling `read_row`.
   - Scope the missing-field `KeyError` to `request_dict[self._row_key]` and 
include `self._row_key` in the message (so custom `row_key_fn` failures are not 
rewritten).
   - Use `%r` in `get_cache_key` so `None` and the string `"None"` do not share 
a Redis cache key.
   
   ## Testing
   
   - Reproduced both failures with a mocked table (queried `b'None'`; blank 
KeyError text).
   - Added unit tests for `None` keys at each `ExceptionLevel`, missing-field 
message, `row_key_fn` KeyError passthrough, and cache-key distinction.
   - `pytest` on `bigtable_test.py`: 8 passed
   - `yapf` / `ruff` clean
   


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