Skip to content

Conversation

@Shizoqua
Copy link

@Shizoqua Shizoqua commented Jan 2, 2026

Summary

This PR fixes behavior in feast.image_utils when optional image dependencies are not installed, and adds unit tests to cover the expected failure mode.

While validating the fix locally, I also addressed a few test-harness issues that prevented running unit tests in a minimal environment (without integration/auth optional deps).

Changes

  • Ensure validate_image_format and get_image_metadata call _check_image_dependencies() so they raise a clear ImportError when feast[image] deps are missing (instead of failing with a NameError due to missing PIL.Image).
  • Add unit tests for missing optional image dependencies:
    • sdk/python/tests/unit/test_image_utils_optional_deps.py
  • Unblock unit test execution in minimal environments:
    • Update pytest.ini for pytest 8 compatibility (remove invalid warning filter) and remove env= config that requires extra plugins.
    • Make tests/conftest.py safe to import without optional integration/auth dependencies (guard imports).
    • Fix Windows multiprocessing start method selection (sys.platform is win32, not windows).

Why

  • Prevent confusing runtime failures when optional feast[image] dependencies are not installed.
  • Improve contributor experience by allowing unit tests to run without requiring integration-only packages.

Test Plan

  • python -m pytest -q tests/unit/test_image_utils_optional_deps.py

Open with Devin

@Shizoqua Shizoqua requested a review from a team as a code owner January 2, 2026 23:17
@Shizoqua Shizoqua force-pushed the bugfix/contrib-quickfix branch from 017a91a to fc9bb71 Compare January 2, 2026 23:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes error handling in feast.image_utils when optional image dependencies are missing and enables unit tests to run in minimal environments without integration dependencies.

  • Adds _check_image_dependencies() calls to validate_image_format and get_image_metadata to raise clear ImportError when image dependencies are missing
  • Adds unit tests to verify optional dependency handling
  • Updates test infrastructure to support running unit tests without optional integration/auth dependencies

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
sdk/python/feast/image_utils.py Added dependency checks to image validation and metadata extraction functions
sdk/python/tests/unit/test_image_utils_optional_deps.py New unit tests verifying ImportError behavior when image dependencies are unavailable
sdk/python/tests/conftest.py Wrapped integration and auth test imports in try-except blocks to allow conftest loading without optional dependencies; fixed Windows platform detection
sdk/python/pytest.ini Removed deprecated pytest configuration for pytest 8 compatibility

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Shizoqua Shizoqua force-pushed the bugfix/contrib-quickfix branch 2 times, most recently from 35db3ae to d8fd430 Compare January 9, 2026 02:03
Shizoqua and others added 5 commits January 10, 2026 05:06
Signed-off-by: Shizoqua <hr.lanreshittu@yahoo.com>
Signed-off-by: Lanre Shittu <136805224+Shizoqua@users.noreply.github.com>
Signed-off-by: Shizoqua <hr.lanreshittu@yahoo.com>
Signed-off-by: Shizoqua <hr.lanreshittu@yahoo.com>
Signed-off-by: Lanre Shittu <136805224+Shizoqua@users.noreply.github.com>
Signed-off-by: Shizoqua <hr.lanreshittu@yahoo.com>
Signed-off-by: Lanre Shittu <136805224+Shizoqua@users.noreply.github.com>
Signed-off-by: Shizoqua <hr.lanreshittu@yahoo.com>
…s.py

Signed-off-by: Lanre Shittu <136805224+Shizoqua@users.noreply.github.com>
Signed-off-by: Shizoqua <hr.lanreshittu@yahoo.com>
Signed-off-by: Shizoqua <hr.lanreshittu@yahoo.com>
Signed-off-by: Shizoqua <hr.lanreshittu@yahoo.com>
@Shizoqua
Copy link
Author

Good day @franciscojavierarceo
I would appreciate it if my PR is looked at and reviewed.

@Shizoqua
Copy link
Author

Good day @franciscojavierarceo
I would appreciate it if my PR is reviewed.

@Shizoqua
Copy link
Author

Hello,
Good day @franciscojavierarceo
Just a quick reminder of my PR getting reviewed.

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

View issue and 6 additional flags in Devin Review.

Open in Devin Review

Comment on lines +291 to +292
if not _integration_test_deps_available:
pytest.skip("Integration test dependencies are not available")
Copy link
Contributor

Choose a reason for hiding this comment

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

🔴 pytest.skip() called during test collection causes collection error instead of graceful skip

Calling pytest.skip() inside pytest_generate_tests() at line 292 is incorrect and will cause a collection error rather than gracefully skipping the test.

Click to expand

Problem

pytest.skip() raises a Skipped exception that is designed to be caught by pytest's test runner during test execution, not during test collection. When called in pytest_generate_tests(), it will cause pytest to report a collection error.

Code path

When _integration_test_deps_available is False (dependencies not installed), the code reaches:

if not _integration_test_deps_available:
    pytest.skip("Integration test dependencies are not available")

This will raise pytest.skip.Exception which is not handled during collection, causing the test suite to error out instead of skipping the tests gracefully.

Proper fix

The correct approach would be to either:

  1. Return early and not parametrize the test (which may cause fixture errors)
  2. Use metafunc.parametrize() with an empty list and mark with pytest.mark.skip
  3. Use pytest.skip(allow_module_level=True) at module level before pytest_generate_tests is called

Impact

When running tests without integration dependencies installed, the test collection will fail with an error instead of gracefully skipping the affected tests.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants