Skip to content

Re-enable Direct and Dataflow inferencePostCommitIT in python313PostCommit - #41595

Closed
damccorm wants to merge 7 commits into
apache:masterfrom
damccorm:reenable-inference-postcommit
Closed

damccorm wants to merge 7 commits into
apache:masterfrom
damccorm:reenable-inference-postcommit

Conversation

@damccorm

@damccorm damccorm commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Re-enables :sdks:python:test-suites:direct:py313:inferencePostCommitIT (which includes feastIntegrationTest, testcontainersTest, and Direct RunInference ITs) and :sdks:python:test-suites:dataflow:py313:inferencePostCommitIT (vertexAIInferenceTest, geminiInferenceTest, mockAPITests) in python313PostCommit.

Both tasks were unintentionally dropped from build.gradle.kts when Python 3.9 (#36665) and Python 3.10 (#40413) support were removed without migrating the dependencies to python311PostCommit / python313PostCommit.

Prerequisite PR stack

To keep reviews small and focused, the individual Python 3.13 / Direct inferencePostCommitIT fixes from this branch have been split into independent prerequisite PRs against master (all verified together in green PostCommit Python (3.13) run 45406881889):

Once #41639–#41643 are merged into master, merging master into this PR will reduce its diff to just build.gradle.kts (re-enabling direct:py313:inferencePostCommitIT and dataflow:py313:inferencePostCommitIT) and .github/trigger_files/beam_PostCommit_Python.json.

(Also restored the 15 missing COCO val2017 JPEG inputs referenced by gs://apache-beam-ml/testing/inputs/it_coco_validation_inputs.txt into gs://apache-beam-ml/datasets/coco/raw-data/val2017/.)

@github-actions github-actions Bot added the size/xs XS: <10 lines changed label Nov 23, 2026
@damccorm damccorm changed the title Re-enable Direct and Dataflow inferencePostCommitIT in python311PostCommit Re-enable Direct and Dataflow inferencePostCommitIT in python313PostCommit Nov 23, 2026
- feast_tests_requirements.txt: install feast with fsspec and
  google-cloud-bigquery[pandas] instead of feast[gcp] so it does not
  downgrade google-cloud-storage from 3.x to 2.x in the shared venv.
- feast_feature_store_it_test.py: inline ValidateResponse instead of
  importing it from vertex_ai_feature_store_it_test (which skips on
  missing testcontainers.redis).
- direct/common.gradle:
  - remove obsolete scikit-learn<1.2.0 downgrade in sklearnInferenceTest
  - export TF_USE_LEGACY_KERAS=1 in tensorflowInferenceTest
  - install enrichment_tests_requirements.txt (redis) in testcontainersTest
- tensorflow_tests_requirements.txt: use tf-keras and tensorflow>=2.16,<2.22
  on Python >=3.12 while preserving keras<3 / tensorflow<2.16 on Python <3.12
  for Python 3.11 Dataflow cost benchmarks.
- torch_tests_requirements.txt & huggingface_tests_requirements.txt: cap
  torch<2.12.0 to avoid triton>=3.7 LLVM option collision with tensorflow,
  and add tf-keras / tensorflow<2.22 bounds in huggingface_tests_requirements.
- Remove remaining datatable references from xgboost ITs/example/unit test
  following PR apache#41586.
@github-actions github-actions Bot added python examples core size/m M: 50-249 lines changed and removed size/xs XS: <10 lines changed labels Nov 24, 2026
@codecov

codecov Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.42%. Comparing base (80fa944) to head (bb52bcf).
⚠️ Report is 21 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #41595      +/-   ##
============================================
+ Coverage     59.40%   59.42%   +0.02%     
  Complexity     5137     5137              
============================================
  Files          1470     1470              
  Lines        187620   187727     +107     
  Branches       3819     3819              
============================================
+ Hits         111451   111562     +111     
+ Misses        72762    72758       -4     
  Partials       3407     3407              
Flag Coverage Δ
python 80.68% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…Python 3.13

- huggingface_inference.py & huggingface_inference_test.py: wrap single-dict
  predictions from Hugging Face pipelines (such as QuestionAnsweringPipeline
  on batch size 1) in a list before calling utils._convert_to_result, fixing
  the regression from apache#36593.
- huggingface_inference_it_test.py, huggingface_language_modeling.py, README.md:
  replace the unavailable third-party stevhliu/my_awesome_eli5_mlm_model Hub
  checkpoint with FacebookAI/roberta-base (inlining expected outputs so the
  shared GCS golden file is unchanged) and replace removed tokenizer.encode_plus
  with tokenizer(...) for transformers 5.x compatibility.
- pytorch_inference_it_test.py: compare MaskRCNN detection outputs using exact
  top-5 match plus >=0.8 multiset IoU so +/-1 pixel bilinear resize rounding
  differences in Pillow 13.0.0 do not break borderline detections near 0.05
  (after restoring the 15 missing COCO val2017 images to gs://apache-beam-ml).
- bigquery_it_test.py: assert Exception instead of bare ValueError in the three
  empty-results exception ITs so Prism/TestDirectRunner RuntimeError wrappers
  are accepted, matching bigtable_it_test.py and vertex_ai_feature_store_it_test.py.
- direct/common.gradle: give each direct inference/enrichment Gradle task a
  distinct JUnit suite name so per-task XML reports are not overwritten.
…uery_it_test

- huggingface_inference.py & huggingface_inference_test.py: move the
  single-dict batch wrapping from HuggingFacePipelineModelHandler.run_inference
  into _default_pipeline_inference_fn so custom inference_fn implementations
  returning columnar dicts (such as Beam YAML's runinference_huggingface.yaml)
  are still transposed by utils._convert_to_result; add a unit test for this.
- bigquery_it_test.py: narrow assertRaisesRegex from Exception to
  (ValueError, RuntimeError) so unittest.SkipTest raised by TestPipeline when
  --test-pipeline-options is absent is not caught in PreCommit Python Coverage.
@damccorm

Copy link
Copy Markdown
Contributor Author

Split into native stacked PR chain: #41644 -> #41645 -> #41646 -> #41647 -> #41648 -> #41649.

@damccorm damccorm closed this Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant