| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…uckDB offline store Motivation: When using the DuckDB/ibis offline store, a FileSource whose file_format could not be determined (file_format not set and the path does not end in ".parquet", and it is not a Delta table) caused `_read_data_source()` in duckdb.py to fall through its if/elif chain and implicitly return None. That None then propagated to callers that called `.mutate(...)` on it, crashing several stack frames away from the real problem with `AttributeError: 'NoneType' object has no attribute 'mutate'`, with no indication of the actual cause. Approach: Add an explicit `else` branch to `_read_data_source()` that raises a `ValueError` explaining that the file format could not be determined, and suggesting the user either set `file_format` explicitly on the FileSource (e.g. ParquetFormat()) or use a path with a recognized extension (e.g. ".parquet"). This replaces a silent None return with an actionable error at the point where the format could not be resolved. Validation: Added sdk/python/tests/unit/infra/offline_stores/test_duckdb.py, which constructs a FileSource with an unresolvable format (a ".csv" path, no explicit file_format) and asserts that `_read_data_source` raises ValueError. Report: feast-dev#5390 Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com> Assisted-by: claude-sonnet-5 (via Claude Code)
|
⚠️ Please install the Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## master #6776 +/- ##
=======================================
Coverage 47.09% 47.09%
=======================================
Files 419 419
Lines 51878 51879 +1
Branches 7525 7525
=======================================
+ Hits 24430 24434 +4
+ Misses 25700 25694 -6
- Partials 1748 1751 +3
Continue to review full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
What this PR does / why we need it:
When using the DuckDB/ibis offline store, a FileSource whose file_format could not be
determined (not set explicitly, and the path doesn't end in .parquet, and it isn't a
Delta table) caused _read_data_source() in duckdb.py to fall through its if/elif
chain and implicitly return None. That None then propagated into ibis.py's
read_fv(), which calls .mutate(...) on it, crashing several stack frames away from the
real problem with AttributeError: 'NoneType' object has no attribute 'mutate', giving the
user no indication of the actual cause.
This PR adds an explicit else branch that raises a clear ValueError at the point where
the format could not be resolved, telling the user to either set file_format explicitly
on the FileSource or use a path with a recognized extension (e.g. .parquet).
This does not change behavior for any currently-working FileSource: feast/data_format.py
only defines ParquetFormat and DeltaFormat, both of which are already handled by the
preceding branches. It only replaces a silent None return with an actionable error.
Which issue(s) this PR fixes:
Fixes #5390
Checks
Testing Strategy
Added sdk/python/tests/unit/infra/offline_stores/test_duckdb.py, which constructs a
FileSource with an unresolvable format (a .csv path, no explicit file_format) and
asserts that _read_data_source raises ValueError. Confirmed the test fails with
DID NOT RAISE <class 'ValueError'> against the code before this change, and passes after.
Ran:
Misc
Note: base master CI was green at the time of this PR (checked via gh run list).