Skip to content

Commit 050dc2d

Browse files
committed
address feedback
1 parent 4827822 commit 050dc2d

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

sdv/multi_table/base.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -476,11 +476,10 @@ def _assign_table_transformers(self, synthesizer, table_name, table_data):
476476
column_name_to_transformers = {}
477477

478478
primary_key = self.metadata.tables[table_name].primary_key
479-
foreign_keys = self.metadata._get_all_foreign_keys(table_name)
480-
for foreign_key in foreign_keys:
481-
if foreign_key != primary_key:
482-
column_name_to_transformers[foreign_key] = None
483-
479+
foreign_key_columns = self.metadata._get_all_foreign_keys(table_name)
480+
column_name_to_transformers = {
481+
column_name: None for column_name in foreign_key_columns if column_name != primary_key
482+
}
484483
synthesizer.update_transformers(column_name_to_transformers)
485484

486485
def auto_assign_transformers(self, data):

sdv/multi_table/hma.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -788,10 +788,14 @@ def _add_foreign_key_columns(self, child_table, parent_table, child_name, parent
788788
foreign key values (from the parent table's PK).
789789
790790
Args:
791-
child_table (pd.DataFrame): The child table which may or may not contain the FK columns.
792-
parent_table (pd.DataFrame): The parent table.
793-
child_name (str): The name of the child table in the metadata.
794-
parent_name (str): The name of the parent table in the metadata.
791+
child_table (pd.DataFrame):
792+
The child table which may or may not contain the FK columns.
793+
parent_table (pd.DataFrame):
794+
The parent table which. contains the primary key ID values.
795+
child_name (str):
796+
The name of the child table in the metadata.
797+
parent_name (str):
798+
The name of the parent table in the metadata.
795799
796800
Returns:
797801
None: The child_table is modified in-place.

0 commit comments

Comments
 (0)