kzosabe commented on a change in pull request #18694:
URL: https://github.com/apache/superset/pull/18694#discussion_r805313408
##########
File path: superset/db_engine_specs/bigquery.py
##########
@@ -185,6 +187,49 @@ class BigQueryEngineSpec(BaseEngineSpec):
),
}
+ @classmethod
+ def get_allow_cost_estimate(cls, extra: Dict[str, Any]) -> bool:
+ return True
+
+ @classmethod
+ def estimate_statement_cost(
+ cls, statement: str, cursor: Any, engine: Engine
Review comment:
The only way to estimate the cost in advance in BigQuery is to run the
query with dry_run, and since this is not possible with only cursor, I add
engine as an argument.
Another way to handle bigquery.Client directly is to configure sqlalchemy to
pass the dryrun parameter when creating the connection, but this seems to be
more complicated...
https://github.com/googleapis/python-bigquery-sqlalchemy#connection-string-parameters
--
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]