You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/06/18 21:20:01 UTC
[GitHub] [superset] betodealmeida commented on a change in pull request #15241: feat: query datasets from SQL Lab
betodealmeida commented on a change in pull request #15241:
URL: https://github.com/apache/superset/pull/15241#discussion_r654007140
##########
File path: superset/jinja_context.py
##########
@@ -551,3 +553,45 @@ def get_template_processor(
else:
template_processor = NoOpTemplateProcessor
return template_processor(database=database, table=table, query=query, **kwargs)
+
+
+def dataset_macro(dataset_id: int) -> str:
+ """
+ Given a dataset ID, return the SQL that represents it.
+ """
+ from superset import db
+ from superset.connectors.sqla.models import SqlaTable
+
+ dataset = db.session.query(SqlaTable).filter_by(id=dataset_id).one()
+ columns = [column.column_name for column in dataset.columns]
+ query_obj = {
+ "apply_fetch_values_predicate": False,
+ "granularity": "order_date",
Review comment:
Need to remove this
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org