Thanks to visit codestin.com
Credit goes to github.com

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

@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 from f98955a to 96051fa Compare January 3, 2026 16:19
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.

1 participant