soaring0616 opened a new pull request, #59550: URL: https://github.com/apache/spark/pull/59550
### What changes were proposed in this pull request? Add `ReadLimitRegistryTests` to `test_python_streaming_datasource.py`: - rebuild each builtin `ReadLimit` (`ReadAllAvailable`, `ReadMinRows`, `ReadMaxRows`, `ReadMaxFiles`, `ReadMaxBytes`) form its dict form via `ReadLimitRegistry.get` - verify that `PySparkException` is raised for a missing (`None`) or unregistered `_type` Test-only change; no source code is modified. ### Why are the changes needed? `ReadLimitRegistry` shows as uncovered in the Python test coverage report. None of the existing Python tests construct `ReadMinRows`, `ReadMaxFiles` or `ReadMaxBytes`, and the error paths of `get` are not tested. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Added unit tests. To run them: python/run-tests --testnames "pyspark.sql.test.test_python_streaming_datasource ReadLimitRegistryTests" In a local run of `test_python_streaming_datasource` with `run-tests-with-coverage`, coverage of `datasource_internal.py` went from 39% to 57%. The duplicate-registration check in `__register` is not reachable through the public interface and is not covered. Each test was also checked to fail when the corresponding registration or check is removed. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Sonnet 5.5 (Claude-Code) -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
