Skip to content

[Python] Fix Feast and BigQuery enrichment ITs for Python 3.13 and Prism - #41647

Open
damccorm wants to merge 1 commit into
users/damccorm/py313-inference-3-pytorchfrom
users/damccorm/py313-inference-4-enrichment
Open

damccorm wants to merge 1 commit into
users/damccorm/py313-inference-3-pytorchfrom
users/damccorm/py313-inference-4-enrichment

Conversation

@damccorm

@damccorm damccorm commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Part of #41652 (stack: https://github.com/apache/beam/stack/41650).

Stack 4/6 — Fixes feastIntegrationTest and bigquery_it_test.py (testcontainersTest) on Python 3.13 / Prism:

  • Prevent google-cloud-storage downgrade (feast_tests_requirements.txt): Replace feast[gcp] with feast, fsspec>=2024.1.0, and google-cloud-bigquery[pandas]<4,>=2. feast[gcp] pins google-cloud-storage<3, which downgraded google-cloud-storage 3.x -> 2.19.0 in the shared direct:py313 virtualenv and broke GCS reads (raw_download=True) in subsequent tasks. The remaining GCP client packages are already installed by apache-beam[gcp].
  • Avoid collection skip (feast_feature_store_it_test.py): Inline ValidateResponse instead of importing it from vertex_ai_feature_store_it_test.py, which raised SkipTest during collection when testcontainers.redis dependencies were not yet installed.
  • Accept Prism RuntimeError wrapper without swallowing SkipTest (bigquery_it_test.py): Narrow the three empty-results exception assertions (added in Handle query returned with empty rows gracefully on bigquery enrichmement #36791) to assertRaisesRegex((ValueError, RuntimeError), "no matching row found for query") so TestDirectRunner/Prism RuntimeError wrappers pass while unittest.SkipTest still propagates in non-IT suites like PreCommit Python Coverage.

Verification

@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 58.04%. Comparing base (ac0682c) to head (5f99f26).

Additional details and impacted files
@@                             Coverage Diff                             @@
##             users/damccorm/py313-inference-3-pytorch   #41647   +/-   ##
===========================================================================
  Coverage                                       58.04%   58.04%           
  Complexity                                       2844     2844           
===========================================================================
  Files                                            1210     1210           
  Lines                                          173284   173284           
  Branches                                         2329     2329           
===========================================================================
+ Hits                                           100586   100587    +1     
+ Misses                                          69988    69987    -1     
  Partials                                         2710     2710           
Flag Coverage Δ
python 80.67% <ø> (+<0.01%) ⬆️

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.

@damccorm

Copy link
Copy Markdown
Contributor Author

stop reviewer notifications

- 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 test virtualenv.
- feast_feature_store_it_test.py: inline ValidateResponse instead of importing
  it from vertex_ai_feature_store_it_test, which skipped collection when
  testcontainers.redis was not installed yet.
- bigquery_it_test.py: assert (ValueError, RuntimeError) in the three
  empty-results exception tests so Prism/TestDirectRunner RuntimeError wrappers
  are accepted while unittest.SkipTest still propagates when --test-pipeline-options
  is not passed.
@damccorm
damccorm force-pushed the users/damccorm/py313-inference-4-enrichment branch from 94d8192 to 5f99f26 Compare November 24, 2026 20:08
@damccorm
damccorm marked this pull request as ready for review November 24, 2026 20:08
@github-actions

Copy link
Copy Markdown
Contributor

Stopping reviewer notifications for this pull request: requested by reviewer. If you'd like to restart, comment assign set of reviewers

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📋 Review Summary

This PR resolves Python 3.13 and Prism integration test issues for Feast and BigQuery enrichment handlers. It prevents feast[gcp] from downgrading google-cloud-storage in shared virtual environments, decouples feast_feature_store_it_test.py from vertex_ai_feature_store_it_test.py to avoid SkipTest during collection when testcontainers is absent, and updates bigquery_it_test.py assertions to handle Prism's RuntimeError exception wrapper.

🔍 General Feedback

  • The changes are well-scoped, clean, and directly address the root causes of the test failures without introducing side effects.

💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.

@jrmccluskey jrmccluskey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just one nit that we can come back to later

Comment on lines +18 to +24
# Install feast without the [gcp] extra because feast[gcp] pins
# google-cloud-storage<3, which conflicts with Beam's google-cloud-storage>=3,<4
# requirement and downgrades it in the shared test virtualenv. The remaining GCP
# client packages are already installed by apache-beam[gcp].
feast
fsspec>=2024.1.0
google-cloud-bigquery[pandas]<4,>=2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a consideration for review here, but the problem of keeping these test requirements.txt files in line with mainline Beam requirements has been nagging at me lately. Perhaps this is another good use case for uv, just checking if we can get valid installs with current beam requirements + the test requirements file and surface the mismatch earlier.

'Feast feature store test dependencies are not installed.')


class ValidateResponse(beam.DoFn):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: if this is useful in multiple test suites we should probably split it out as a helper in a utility file somewhere to reduce code duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core python size/s S: 10-49 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants