guydou commented on a change in pull request #15502:
URL: https://github.com/apache/superset/pull/15502#discussion_r663944662
##########
File path: superset/connectors/sqla/models.py
##########
@@ -404,9 +404,14 @@ class SqlMetric(Model, BaseMetric):
)
export_parent = "table"
+ def get_template_processor(self, **kwargs: Any) -> BaseTemplateProcessor:
+ return self.table.get_template_processor()
+
def get_sqla_col(self, label: Optional[str] = None) -> Column:
label = label or self.metric_name
- sqla_col: ColumnClause = literal_column(self.expression)
+ sqla_col: ColumnClause = literal_column(
+ self.get_template_processor().process_template(self.expression)
+ )
Review comment:
Got it,
Fixed the code,
Why it is not recommended to have new instance method? I am asking only yo
expand my knowledge
Thanks
--
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]