| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
⚠️ Please install the Codecov Report❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
@@ 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
... and 6 files with indirect coverage changes Continue to review full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Sorry, something went wrong.
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>
| Back | FazBrowse Home | New Git URL |
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
Testing Strategy
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.