HyukjinKwon opened a new pull request, #411: URL: https://github.com/apache/spark-connect-rust/pull/411
### What changes were proposed in this pull request? [SPARK-61230](https://issues.apache.org/jira/browse/SPARK-61230): Omit from the Python coverage the seven files that are vendored verbatim from Apache Spark but were still measured, and add a check that keeps the omit list in sync with the vendored lists. `python/.coveragerc` measures the hand-written Python of the drop-in. It omits the files vendored byte-for-byte from the `v4.3.0` tag, which Apache's own tests cover, and its comment says to keep that list in sync with `VENDORED_DIRS`/`VENDORED_FILES` of `scripts/check_vendored_upstream.sh`. These vendored files were still measured: | file | units (statements + branches) | uncovered | |---|---|---| | `conf.py` | 141 | 56 | | `taskcontext.py` | 157 | 101 | | `traceback_utils.py` | 52 | 42 | | `sql/geo_utils.py` | 50 | 5 | | `sql/sql_formatter.py` | 58 | 45 | | `sql/connect/profiler.py` | 13 | 0 | | `sql/connect/shell/progress.py` | 107 | 18 | This adds them to the omit list, and adds `scripts/tests/test_coverage_scope.py`, which the lint workflow runs (`python3 -m unittest discover -s scripts/tests`). It fails when a Python file of the vendored lists is not omitted, so the two lists cannot drift apart again. ### Why are the changes needed? The Python coverage badge should measure what its scope says: the drop-in's own code. On master it is 85.40% (4827 of 5652 units); with the vendored files omitted it is 89.00% (4516 of 5074). Follow-up PRs add tests for the drop-in's own uncovered code. ### Does this PR introduce _any_ user-facing change? No, the coverage scope and a check only. ### How was this patch tested? - The new test passes, and fails without the `.coveragerc` change (it lists the seven files). - `python3 -m unittest discover -s scripts/tests`: 16 tests pass. ruff 0.14.0 passes on `scripts/`. - The numbers above are from the CI command of the coverage job (`coverage run --rcfile=.coveragerc -m pytest tests/test_dropin_offline.py tests/test_arrow_handoff.py tests/test_ml_offline.py`, 2819 passed) on master `cefa44df`. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Opus 5.5 This pull request and its description were written by Isaac. -- 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]
