willbarrett commented on a change in pull request #10106:
URL: 
https://github.com/apache/incubator-superset/pull/10106#discussion_r442620065



##########
File path: superset/connectors/sqla/models.py
##########
@@ -1169,24 +1189,30 @@ def fetch_metadata(self, commit: bool = True) -> None:
         dbcols = (
             db.session.query(TableColumn)
             .filter(TableColumn.table == self)
-            .filter(or_(TableColumn.column_name == col.name for col in 
table.columns))
+            .filter(
+                or_(TableColumn.column_name == col.name for col in 
my_table.columns)
+            )
         )
         dbcols = {dbcol.column_name: dbcol for dbcol in dbcols}
 
-        for col in table.columns:
+        for col in my_table.columns:
             try:
                 datatype = db_engine_spec.column_datatype_to_string(
                     col.type, db_dialect
                 )
-            except Exception as ex:
+            except Exception as ex:  # pylint: disable=broad-except
                 datatype = "UNKNOWN"
-                logger.error("Unrecognized data type in {}.{}".format(table, 
col.name))
+                logger.error("Unrecognized data type in %s.%s", my_table, 
col.name)
                 logger.exception(ex)
             dbcol = dbcols.get(col.name, None)
             if not dbcol:
                 dbcol = TableColumn(column_name=col.name, type=datatype, 
table=self)
-                dbcol.sum = dbcol.is_numeric
-                dbcol.avg = dbcol.is_numeric
+                dbcol.sum = (
+                    dbcol.is_numeric
+                )  # pylint: disable=attribute-defined-outside-init
+                dbcol.avg = (
+                    dbcol.is_numeric
+                )  # pylint: disable=attribute-defined-outside-init

Review comment:
       OK, what's the deal with these two attributes? Is this cruft? Can I kill 
it? does anyone know?




----------------------------------------------------------------
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.

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