Repository navigation
fix: fail-fast import guard for ArrowSerializer when pyarrow missing - #29
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
The import guard in auto_serializer.py was ineffective because ArrowSerializer class was always defined and importable - the ImportError only fired in __init__(), after the guard had passed. Fix: Raise ImportError at module level when pyarrow isn't installed, so the import guard actually catches it: Before (broken): auto_serializer.py: from .arrow_serializer import ArrowSerializer ✓ auto_serializer.py: HAS_ARROW_SERIALIZER = True # Wrong! ArrowSerializer.__init__(): raise ImportError # Too late After (fixed): arrow_serializer.py: import pyarrow → ImportError auto_serializer.py: from .arrow_serializer... → ImportError caught auto_serializer.py: HAS_ARROW_SERIALIZER = False # Correct! Adds test coverage for the import guard by mocking pyarrow unavailability.
27Bslash6
force-pushed
the
fix/arrow-serializer-import-guard
branch
from
December 17, 2025 23:47
c460108 to
7dd8597
Compare
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
Fixes a timing mismatch in the import guard that caused
HAS_ARROW_SERIALIZERto be incorrectly set toTrueeven when pyarrow wasn't installed.The Bug
The Fix
Fail-fast at module level so the import guard catches it:
Test plan
make quick-checkpasses