FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: Refresh the SQL registry cache after deleting a permission by LuisFigueroaG · Pull Request #6953 · feast-dev/feast · GitHub

Repository navigation

fix: Refresh the SQL registry cache after deleting a permission - #6953

Merged
ntkathole merged 1 commit into
feast-dev:masterfrom
LuisFigueroaG:fix/sql-registry-delete-permission-refresh
Oct 7, 2026
Merged

ntkathole merged 1 commit into
feast-dev:masterfrom
LuisFigueroaG:fix/sql-registry-delete-permission-refresh

Conversation

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

SqlRegistry.delete_permission ran its own DELETE and returned, bypassing _delete_object. It therefore didn't update the project's last-updated metadata and didn't refresh the cache in sync mode, so list_permissions(allow_cache=True) kept returning the deleted permission.

Routing it through _delete_object (as the Snowflake registry already does) wasn't enough on its own: _delete_object called self.refresh() inside the open write transaction, so the cache was rebuilt from a snapshot that still contained the deleted row. delete_entity and the other deletes have the same problem on master; for example, list_entities(allow_cache=True) still returns a deleted entity. This moves the refresh after the transaction commits, which is what _apply_object already does.

Which issue(s) this PR fixes:

No existing issue.

Checks

  • I've made sure the tests are passing.
  • My commits are signed off (git commit -s)
  • My PR title follows conventional commits format

Testing Strategy

  • Unit tests
  • Integration tests
  • Manual tests
  • Testing is not required for this change

Added test_delete_permission_refreshes_cache and test_delete_entity_refreshes_cache to test_sql_registry.py (sqlite registry, sync cache mode). The permission test also checks that a second delete still raises PermissionNotFoundException. Both fail on master and pass with this change. ruff and mypy pass on the changed files. The registry, permissions and local feature store unit tests pass, apart from two tests that need a Java runtime and fail the same way on master in my environment.

LuisFigueroaG requested a review from a team as a code owner October 6, 2026 01:27

codecov-commenter commented Oct 6, 2026 •
edited
Loading

Copy link
Copy Markdown

⚠️ Please install the to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 49.01%. Comparing base (7087f1f) to head (6e19b21).
⚠️ Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
sdk/python/feast/infra/registry/sql.py 75.00% 0 Missing and 1 partial ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files

@@            Coverage Diff             @@
##           master    #6953      +/-   ##
==========================================
- Coverage   49.08%   49.01%   -0.08%     
==========================================
  Files         433      435       +2     
  Lines       54332    54501     +169     
  Branches     7917     7947      +30     
==========================================
+ Hits        26667    26711      +44     
- Misses      25788    25917     +129     
+ Partials     1877     1873       -4     
Flag Coverage Δ
go-feature-server 30.58% <ø> (ø)
python-unit 50.39% <75.00%> (-0.09%) ⬇️
Files with missing lines Coverage Δ
sdk/python/feast/infra/registry/sql.py 60.13% <75.00%> (+0.89%) ⬆️

... and 6 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e2a53bb...6e19b21. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

ntkathole force-pushed the fix/sql-registry-delete-permission-refresh branch from d173693 to 0a3f4e9 Compare October 7, 2026 04:41
delete_permission ran its own DELETE and returned, so unlike the other
delete_* methods it never bumped the project's last-updated metadata or
refreshed the cache in sync mode. list_permissions(allow_cache=True)
kept returning the deleted permission.

Route it through _delete_object like the other object types. That alone
wasn't enough: _delete_object refreshed the cache inside the open write
transaction, so the refresh read a snapshot that still contained the
deleted row. Refresh after the transaction commits instead, matching
_apply_object. This also fixes stale cached reads after delete_entity,
delete_data_source and the other deletes that go through _delete_object.

Signed-off-by: LuisFigueroaG <luis.h.figueroa.g@gmail.com>
ntkathole force-pushed the fix/sql-registry-delete-permission-refresh branch from 0a3f4e9 to 6e19b21 Compare October 7, 2026 05:51
ntkathole merged commit 6b212f5 into feast-dev:master Oct 7, 2026
19 of 23 checks passed
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL