fix: add back custom sql filtering with Query as source (#21190)

This commit is contained in:
Hugh A. Miles II
2022-08-26 19:12:21 -07:00
committed by GitHub
parent e2ab966910
commit c61a507e14
5 changed files with 26 additions and 15 deletions

View File

@@ -42,6 +42,7 @@ from sqlalchemy.engine.url import URL
from sqlalchemy.orm import backref, relationship
from superset import security_manager
from superset.jinja_context import BaseTemplateProcessor, get_template_processor
from superset.models.helpers import (
AuditMixinNullable,
ExploreMixin,
@@ -126,6 +127,9 @@ class Query(
__table_args__ = (sqla.Index("ti_user_id_changed_on", user_id, changed_on),)
def get_template_processor(self, **kwargs: Any) -> BaseTemplateProcessor:
return get_template_processor(query=self, database=self.database, **kwargs)
def to_dict(self) -> Dict[str, Any]:
return {
"changedOn": self.changed_on,