Store: add persistent dependency registry and notify hook#2
Store: add persistent dependency registry and notify hook#2sejalpunwatkar wants to merge 2 commits intoBigDataAnalyticsGroup:mainfrom
Conversation
tests/store/test_store.py
Outdated
| store.put(af1) | ||
| store.put(af2) | ||
|
|
||
| store.register_dependency(af1.uuid, af2.uuid) |
There was a problem hiding this comment.
so this is basically a dependency mechanism independent from observable/observers, this means it is up to the user to additonally register those dependencies? That sounds error-prone to me.
In general, this unit test is very short.
store/store.py
Outdated
| def _get_registry(self): | ||
| return self.sqlite_dict[self._registry_key] | ||
|
|
||
| def register_dependency(self, key: int, af_id: int): |
There was a problem hiding this comment.
please make sure to follow the contribution guideline
| ) | ||
|
|
||
| # dependency registry (persistent) | ||
| self._registry_key = "__dependency_registry__" |
There was a problem hiding this comment.
what is the purpose of this string?
tests/store/test_store.py
Outdated
| try: | ||
| store.put(af1) | ||
| except TypeError: | ||
| pass |
There was a problem hiding this comment.
You are suppressing a possible exception here? Why?
- Implement __dependency_registry__ in Store for persistent AF relationships. - Integrate _notify into Store.put for automated, cross-session updates. - Standardize on string keys for SqliteDict to ensure ID consistency. - Add lifecycle unit test with class-level mock for notification verification.
|
Hi @jensdittrich ,
|
|
@jensdittrich I've updated the code to address your feedback, including the automated notifications and expanded tests. Please take a look whenever you have a moment! |
|
I am currently returnign from EDBT, I will take a look at your code next week. |
|
Thank you for the update. I hope the conference was successful and look forward to your feedback next week. In the meantime, I’ll continue reviewing the FQL operators and the group_by logic to see where I can best assist with the next steps. |
Summary
This PR introduces a persistent dependency mechanism for AttributeFunctions within the Store, enabling a foundation for observer-style updates across sessions.
What’s implemented
register_dependency(key, dependent_id)to track relationships between AttributeFunctionsStore.put()to trigger notifications for dependent AttributeFunctionsDesign decisions
update()methods to maintain compatibility with current implementationsTests
Scope
This PR focuses on establishing a persistent observer foundation. It does not enforce or redefine observer/update behavior, leaving room for future API design and refinement.