Mine-Echo opened a new issue, #31695:
URL: https://github.com/apache/superset/issues/31695

   ### Bug description
   
   function convert_tbl_column_to_sqla_col is at superset/models/helpers.py
   
[https://github.com/apache/superset/blob/master/superset/models/helpers.py#L1403](https://github.com/apache/superset/blob/master/superset/models/helpers.py#L1403)
   ```
       def convert_tbl_column_to_sqla_col(
           self,
           tbl_column: "TableColumn",
           label: Optional[str] = None,
           template_processor: Optional[BaseTemplateProcessor] = None,
       ) -> 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)
           type_ = column_spec.sqla_type if column_spec else None
           if expression := tbl_column.expression:
               if template_processor:
                   expression = template_processor.process_template(expression)
               col = literal_column(expression, type_=type_)
           else:
               col = sa.column(tbl_column.column_name, type_=type_)
           col = self.make_sqla_column_compatible(col, label)
           return col
   ```
   why here use self.type but not tbl.column? I think the latter is right.
   `column_spec = db_engine_spec.get_column_spec(self.type, 
db_extra=self.db_extra)`
   When debugging, I found self,type is "table", then column_spec will be None. 
I think self.type is not native type of the column, here we should pass 
tal_column. type, which is "IPADDR" in my case. After I modify this, I 
successfully processed data types by literal_processor while using filters. For 
example, I process "127.0.0.1" to "ipaddr(\"127.0.0.1\")" when filtering.
   Is this really a bug in superset? Or did I just understand it wrong 
somewhere?
   
   ### Screenshots/recordings
   
   _No response_
   
   ### Superset version
   
   master / latest-dev
   
   ### Python version
   
   3.11
   
   ### Node version
   
   16
   
   ### Browser
   
   Chrome
   
   ### Additional context
   
   _No response_
   
   ### Checklist
   
   - [X] I have searched Superset docs and Slack and didn't find a solution to 
my problem.
   - [X] I have searched the GitHub issue tracker and didn't find a similar bug 
report.
   - [X] I have checked Superset's logs for errors and if I found a relevant 
Python stacktrace, I included it here as text in the "additional context" 
section.


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