betodealmeida commented on a change in pull request #8172: Allow users to estimate query cost before executing it URL: https://github.com/apache/incubator-superset/pull/8172#discussion_r325234987
########## File path: superset/views/core.py ########## @@ -2391,6 +2396,34 @@ def select_star(self, database_id, table_name, schema=None): mydb.select_star(table_name, schema, latest_partition=True, show_cols=True) ) + @has_access_api + @expose("/estimate_query_cost/<database_id>/", methods=["POST"]) + @expose("/estimate_query_cost/<database_id>/<schema>/", methods=["POST"]) + @event_logger.log_this + def estimate_query_cost(self, database_id: int, schema: str = None) -> Response: + mydb = db.session.query(models.Database).filter_by(id=database_id).first() Review comment: Ah, I wasn't familiar with `one_or_none()`, seems better suited. I'll change. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For additional commands, e-mail: notifications-h...@superset.apache.org