Skip to content

Fix for Table level isssues and enhancements#37

Merged
AbdealiLoKo merged 5 commits intomasterfrom
add_36
Feb 2, 2023
Merged

Fix for Table level isssues and enhancements#37
AbdealiLoKo merged 5 commits intomasterfrom
add_36

Conversation

@indiVar0508
Copy link
Copy Markdown
Contributor

No description provided.

@indiVar0508 indiVar0508 changed the title Add support for parent_table_map Add(#36) support for parent_table_map Nov 9, 2022
@AbdealiLoKo
Copy link
Copy Markdown
Contributor

  1. If __version_parent__ is already there - why do we need manager.version_class_map ?
  2. Similar quetion for tables ?
  3. If we are adding association_tables_map - then do we need manager.association_tables and manager.association_version_tables

@indiVar0508 indiVar0508 linked an issue Dec 2, 2022 that may be closed by this pull request
@indiVar0508 indiVar0508 force-pushed the add_36 branch 2 times, most recently from 794c2ee to 28615f8 Compare January 9, 2023 12:19
@indiVar0508 indiVar0508 linked an issue Jan 12, 2023 that may be closed by this pull request
@indiVar0508 indiVar0508 changed the title Add(#36) support for parent_table_map Fix for Table level isssues and enhancements Jan 12, 2023
Comment on lines +137 to +138
self._association_parent_tables = set()
self._association_version_tables = set()
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

        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

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
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Why is version_class_map a dict but assocication_version_tables a set ? Can we make it consistent
  2. Why do we need parent_class_map if we have a version_class_map - isnt it just the reversed form ?
  3. Why does association_version_tables track 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.
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 AbdealiLoKo merged commit 67d7649 into master Feb 2, 2023
@AbdealiLoKo AbdealiLoKo deleted the add_36 branch February 2, 2023 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

user_defined table not working issue Add parent_table_map/version_table_map

2 participants