arijeetmukherjee3108-droid opened a new pull request, #41680: URL: https://github.com/apache/beam/pull/41680
Fixes #41679 ### Summary - Guard `_extract_and_convert()` in `sdks/python/apache_beam/ml/rag/ingestion/spanner.py` so `convert_fn` is only invoked when the extracted value is not `None`, matching `mysql_common.py` and `postgres_common.py`. - Widen `python_type` from `type` to `Any` on `SpannerColumnSpec` and `SpannerColumnSpecsBuilder.add_metadata_field()` so nullable typing forms like `Optional[str]` pass static type checking. - Add unit tests in `sdks/python/apache_beam/ml/rag/ingestion/spanner_test.py` covering missing metadata fields, explicit `None` values, present values, falsy non-`None` values (`0`, `""`), non-`None` defaults, and `RowCoder` round-trip serialization. ### Testing - Ran `pytest sdks/python/apache_beam/ml/rag/ingestion/spanner_test.py -v` (6 passed). - Verified the missing-field and explicit-`None` tests fail with `AttributeError` on unpatched `master` and pass with the fix. - Verified `yapf --diff` and `git diff --cached --check` report no formatting or whitespace issues. -- 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]
