damccorm opened a new issue, #41652:
URL: https://github.com/apache/beam/issues/41652
### Goal
Re-enable `:sdks:python:test-suites:direct:py313:inferencePostCommitIT`
(`feastIntegrationTest`, `testcontainersTest`, `sklearnInferenceTest`,
`tensorflowInferenceTest`, `torchInferenceTest`, `transformersInferenceTest`,
`xgboostInferenceTest`) and
`:sdks:python:test-suites:dataflow:py313:inferencePostCommitIT`
(`vertexAIInferenceTest`, `geminiInferenceTest`, `mockAPITests`) in
`python313PostCommit`.
### How these tests got disabled
Both suites were unintentionally dropped from `build.gradle.kts` during
Python version removals without migrating them to a supported Python PostCommit
task:
- `:sdks:python:test-suites:direct:py39:inferencePostCommitIT` was dropped
in #36665 (Nov 2025) when `python39PostCommit` was removed.
- `:sdks:python:test-suites:dataflow:py310:inferencePostCommitIT` was
dropped in #40413 when `python310PostCommit` was removed.
### Issues accumulated while disabled / migrating to Python 3.13
Because `direct:py313:inferencePostCommitIT` had not run in CI since Python
3.9 was removed (and had never run on Python 3.13), several dependency,
fixture, and code/test issues accumulated:
1. **XGBoost (`xgboostInferenceTest`):** Leftover `datatable` /
`XGBoostModelHandlerDatatable` references remained after #41586; `datatable`
fails to build from source on Python 3.13.
2. **Hugging Face (`transformersInferenceTest`):**
- Regression from #36593: switching
`HuggingFacePipelineModelHandler.run_inference` to `utils._convert_to_result`
broke pipelines that return a single `dict` for batch size 1 (e.g.
`QuestionAnsweringPipeline` fails with `TypeError: 'float' object is not
iterable`).
- The third-party Hub checkpoint `stevhliu/my_awesome_eli5_mlm_model`
used by the masked-LM IT was deleted/made private (`401
RepositoryNotFoundError`), and `tokenizer.encode_plus(...)` was removed in
`transformers>=5`.
3. **PyTorch (`torchInferenceTest`):**
- The 15 COCO `val2017` JPEG inputs listed in
`gs://apache-beam-ml/testing/inputs/it_coco_validation_inputs.txt` were missing
from `gs://apache-beam-ml/datasets/coco/raw-data/val2017/` after bucket
migration (now restored).
- Pillow `13.0.0` produces a ±1/255 bilinear resize difference on two
COCO images (`000000006818.jpg`, `000000331352.jpg`), reordering nearly-tied
detections and toggling borderline detections near MaskRCNN's `0.05` score
threshold and breaking exact string equality against the GCS golden files.
4. **Enrichment ITs (`feastIntegrationTest`, `testcontainersTest`):**
- `feast[gcp]` in `feast_tests_requirements.txt` pins
`google-cloud-storage<3`, downgrading `google-cloud-storage` 3.x -> 2.19.0 in
the shared `direct:py313` virtualenv and breaking GCS reads
(`raw_download=True`) across subsequent tasks.
- `feast_feature_store_it_test.py` imported `ValidateResponse` from
`vertex_ai_feature_store_it_test.py`, skipping collection whenever
`testcontainers.redis` wasn't installed yet.
- Three empty-results exception tests added to `bigquery_it_test.py` in
#36791 asserted bare `ValueError`, which fails under Prism/`TestDirectRunner`
`RuntimeError` wrapping.
5. **Direct ML test requirements & Gradle task configs
(`direct/common.gradle`, `*_tests_requirements.txt`):**
- `sklearnInferenceTest` still ran an obsolete `pip install
'scikit-learn<1.2.0'` step that fails to build on Python 3.13.
- `tensorflow_tests_requirements.txt` pinned `tensorflow<2.16` +
`keras<3` (no Python 3.13 wheels), and `tensorflowInferenceTest` needed
`TF_USE_LEGACY_KERAS=1` to load legacy TF2 SavedModels under TensorFlow 2.16+.
- `torch_tests_requirements.txt` and `huggingface_tests_requirements.txt`
lacked a `torch<2.12.0` cap (pulling `triton>=3.7`, which aborts with an LLVM
option registration collision when imported alongside TensorFlow) and
TF/`tf-keras` bounds for Python 3.12+.
- `testcontainersTest` did not install
`enrichment_tests_requirements.txt` (`redis`) after `redis` became optional in
#36772.
- All direct inference/enrichment Gradle tasks shared the same JUnit
`suite` name (`postCommitIT-direct-py*`), overwriting each other's JUnit XML
files.
### Resolution PR Stack
Tracked in native GitHub PR stack https://github.com/apache/beam/stack/41650:
- [ ] #41644 — Remove remaining `datatable` references from XGBoost
inference tests and example
- [ ] #41645 — Fix `HuggingFacePipelineModelHandler` single-dict batch
handling and MLM IT
- [ ] #41646 — Tolerate Pillow 13 resize rounding in PyTorch MaskRCNN COCO
ITs
- [ ] #41647 — Fix Feast and BigQuery enrichment ITs for Python 3.13 and
Prism
- [ ] #41648 — Update Direct `inferencePostCommitIT` requirements and Gradle
tasks for Python 3.13
- [ ] #41649 — Re-enable Direct and Dataflow `inferencePostCommitIT` in
`python313PostCommit`
--
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]