docs: Add end-to-end registry deletion lifecycle example and unit test (#5360) - #6504
Conversation
b939040 to
5723ed6
Compare
5723ed6 to
25d077d
Compare
| assert fvs[0].name == driver_fv.name | ||
|
|
||
| # Delete the feature view using objects_to_delete | ||
| test_feature_store.apply( |
There was a problem hiding this comment.
test is using feast apply to delete while docs and docstrings says objects_to_delete or delete_feature_view.
There was a problem hiding this comment.
Good catch, you're right — thanks. Fixed in 92523ec38.
The docs snippet demonstrates store.delete_feature_view(name), but the only test I added went through apply(objects_to_delete=[...], partial=False), so the API the example actually teaches had no coverage at all.
Rather than swap one for the other, I split them, since registry.md legitimately documents both routes:
test_delete_feature_view— mirrors the end-to-end snippet step for step: list, delete by name, list again, then assertget_feature_viewraisesFeatureViewNotFoundException.test_delete_feature_view_raises_when_missing— covers theFeatureViewNotFoundExceptionthatdelete_feature_view's own docstring promises for a name that was never registered.test_apply_delete_feature_view— keeps theobjects_to_delete/partial=Falsepath from the hint block above the example, with a docstring noting it is deliberately thefeast applyroute and distinct from the one above.
I also lifted the shared source frame and registration into two small helpers, so the two lifecycle tests don't duplicate ~30 lines of setup.
Verified locally: the 3 deletion tests pass, and the file is at 24 passed. The 2 failures in test_apply_stream_feature_view / test_apply_stream_feature_view_udf are pre-existing on master — identical with my changes stashed. ruff check and ruff format --check are both clean.
The branch was 151 commits behind, so I rebased onto current master in the same push; that clears the previous out-of-date state.
) The existing registry deletion docs cover the CLI and individual Python SDK delete methods, but lack a single copy-pasteable example showing the full create -> verify -> delete -> confirm flow. - Add an 'End-to-end example' snippet to registry.md that lists a feature view, deletes it with delete_feature_view(), and lists again to confirm. - Add a unit test for FeatureView deletion via apply(objects_to_delete=..., partial=False) to guard the programmatic deletion path. Signed-off-by: Linda Oraegbunam <obielinda@gmail.com>
Addresses review feedback on feast-dev#6504: the new docs snippet demonstrates store.delete_feature_view(name), but the only test added went through apply(objects_to_delete=..., partial=False), so the documented API was still untested. - Add test_delete_feature_view, mirroring the registry.md snippet step for step: list, delete by name, list again, then assert get_feature_view raises FeatureViewNotFoundException. - Add test_delete_feature_view_raises_when_missing, covering the FeatureViewNotFoundException that delete_feature_view's own docstring promises for an unregistered name. - Keep the apply(objects_to_delete=...) test for the `feast apply` path documented in the hint block, and note in its docstring that it is deliberately distinct from delete_feature_view. - Lift the shared source frame and registration into two helpers so the two lifecycle tests do not duplicate ~30 lines of setup. Signed-off-by: Linda Oraegbunam <obielinda@gmail.com>
25d077d to
92523ec
Compare
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6504 +/- ##
==========================================
+ Coverage 46.96% 46.98% +0.02%
==========================================
Files 418 418
Lines 51675 51675
Branches 7485 7485
==========================================
+ Hits 24268 24281 +13
+ Misses 25673 25666 -7
+ Partials 1734 1728 -6
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
What this PR does
Closes #5360.
The existing registry docs already cover the
feast applydeletion warning, the CLI command, the individual Python SDKdelete_*methods, and thepartial=Falsenote. The one remaining gap, as agreed in the issue discussion, is that there is no single, self-contained example showing the complete deletion lifecycle in one place.This PR addresses that gap with a minimal, copy-pasteable addition.
Changes
docs/getting-started/components/registry.md: Adds an "End-to-end example" section demonstrating the full feature view deletion lifecycle — list/verify the object exists, delete it, then list again to confirm removal — and notes that the same pattern applies to other registry objects via their correspondingdelete_*methods.sdk/python/tests/unit/local_feast_tests/test_local_feature_store.py: Addstest_apply_delete_feature_view, which registers an entity and feature view, deletes it usingapply(objects_to_delete=[...], partial=False), and asserts the feature view is gone and thatget_feature_viewraisesFeatureViewNotFoundException.Notes
This keeps the change intentionally small and documentation-focused, per the consensus reached in the issue thread between the maintainer and contributors. Thanks to @Henildiyora for the original snippet draft and review, and to @jyejare for the guidance.