fix: Image utils optional dependency errors and unblock unit tests on minimal env#5808
Open
Shizoqua wants to merge 10 commits intofeast-dev:masterfrom
Open
fix: Image utils optional dependency errors and unblock unit tests on minimal env#5808Shizoqua wants to merge 10 commits intofeast-dev:masterfrom
Shizoqua wants to merge 10 commits intofeast-dev:masterfrom
Conversation
017a91a to
fc9bb71
Compare
Contributor
There was a problem hiding this comment.
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 tovalidate_image_formatandget_image_metadatato raise clearImportErrorwhen 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.
35db3ae to
d8fd430
Compare
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>
bdd4b82 to
2b2a4f2
Compare
Signed-off-by: Shizoqua <hr.lanreshittu@yahoo.com>
Author
|
Good day @franciscojavierarceo |
Author
|
Good day @franciscojavierarceo |
Signed-off-by: Shizoqua <hr.lanreshittu@yahoo.com>
Author
|
Hello, |
Signed-off-by: Shizoqua <hr.lanreshittu@yahoo.com>
5c29c83 to
5cb5c2e
Compare
Author
|
Hello, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes behavior in
feast.image_utilswhen 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
ImportErrorwhenfeast[image]deps are missing (instead of failing with aNameErrordue to missingPIL.Image).env=config that requires extra plugins.sys.platformiswin32, notwindows).Why
feast[image]dependencies are not installed.Test Plan
python -m pytest -q tests/unit/test_image_utils_optional_deps.py