Fix for Table level isssues and enhancements#37
Merged
AbdealiLoKo merged 5 commits intomasterfrom Feb 2, 2023
Merged
Conversation
Contributor
|
794c2ee to
28615f8
Compare
indiVar0508
commented
Jan 12, 2023
sqlalchemy_history/manager.py
Outdated
Comment on lines
+137
to
+138
| self._association_parent_tables = set() | ||
| self._association_version_tables = set() |
Contributor
Author
There was a problem hiding this comment.
self.association_parent_tables = set()
self.association_version_tables = set()
First, let not use a vague term like association_tables - the more accurate name is association_parent_tables
Remove the property association_tables
indiVar0508
commented
Jan 12, 2023
sqlalchemy_history/manager.py
Outdated
| self.version_class_map = {} | ||
| self.parent_class_map = {} | ||
| # Tracke all tables in {assoc_tables mapping, model table mapping} | ||
| self.version_table_map = {} # mapping from parent to versioned table |
Contributor
Author
There was a problem hiding this comment.
- Why is
version_class_mapa dict butassocication_version_tablesa set ? Can we make it consistent - Why do we need
parent_class_mapif we have aversion_class_map- isnt it just the reversed form ? - Why does
association_version_tablestrack only the assoc-tables and not all tables ?
a. We could have a separate variable to track non-assoc tables
b. Increase scope of the current variable to track both
remove unnecessary attribute `__version_parent__` that was being created while building version models and being deleted immediately after setting manager mapping dictionary. setting the mapping dictionary immediately after creating the vers -ioned model for better interpretebility and understanding.
ea029e1 to
718bc5a
Compare
Simplify the mappings we were doing - We now have version_class_map which tracks the ORM models - And version_table_map which currently only tracks the Assoc Tables (in the future we may also track ORM-linked tables)
create mapping to track version_table and parent_table relations using a dictionary. set this dictionary at time of table_builder as done for model_bu -ilder. doing it in table_builder should cover both association_tables as well as ORM model tables.
use manager to give version_table add testcase for version_table
AbdealiLoKo
approved these changes
Feb 2, 2023
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.