ktmud commented on code in PR #19421:
URL: https://github.com/apache/superset/pull/19421#discussion_r853269869


##########
superset/connectors/sqla/models.py:
##########
@@ -1745,13 +1859,16 @@ def fetch_metadata(self, commit: bool = True) -> 
MetadataResult:
         )
 
         # clear old columns before adding modified columns back
-        self.columns = []
+        columns = []
         for col in new_columns:
             old_column = old_columns_by_name.pop(col["name"], None)
             if not old_column:
                 results.added.append(col["name"])
                 new_column = TableColumn(
-                    column_name=col["name"], type=col["type"], table=self
+                    column_name=col["name"],
+                    type=col["type"],
+                    table_id=self.id,
+                    table=self,

Review Comment:
   Yeah, previously I replaced `table` with `table_id` to fix the problem 
mentioned above but added it back after replacing it with another solution: 
assigning the columns list to `self.columns` only after all items are 
collected. I guess I can remove `table_id` again.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to