korbit-ai[bot] commented on code in PR #31780:
URL: https://github.com/apache/superset/pull/31780#discussion_r1909881158


##########
superset/models/helpers.py:
##########
@@ -1419,7 +1419,7 @@ def convert_tbl_column_to_sqla_col(
     ) -> Column:
         label = label or tbl_column.column_name
         db_engine_spec = self.db_engine_spec
-        column_spec = db_engine_spec.get_column_spec(self.type, 
db_extra=self.db_extra)
+        column_spec = db_engine_spec.get_column_spec(tbl_column.type, 
db_extra=self.db_extra)

Review Comment:
   ### Missing type null check <sub>![category 
Functionality](https://img.shields.io/badge/Functionality-0284c7)</sub>
   
   <details>
     <summary>Tell me more</summary>
   
   ###### What is the issue?
   Missing null check for tbl_column.type before calling get_column_spec
   
   ###### Why this matters
   If tbl_column.type is None, get_column_spec() may raise an error since some 
database engines cannot handle None type inputs.
   
   ###### Suggested change ∙ *Feature Preview*
   Add null check before getting column spec:
   ```python
   column_spec = None
   if tbl_column.type is not None:
       column_spec = db_engine_spec.get_column_spec(tbl_column.type, 
db_extra=self.db_extra)
   ```
   
   
   </details>
   
   ###### Chat with Korbit by mentioning @korbit-ai, and give a 👍 or 👎 to help 
Korbit improve your reviews.
   
   <!--- korbi internal id:4fdd68e1-547c-458a-b051-8f63ab58d78b -->
   



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