mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
feat(oauth): adding necessary changes to support bigquery oauth (#30674)
This commit is contained in:
@@ -151,12 +151,13 @@ class TestPostgresDbEngineSpec(TestDbEngineSpec):
|
||||
DB Eng Specs (postgres): Test estimate_statement_cost select star
|
||||
"""
|
||||
|
||||
database = mock.Mock()
|
||||
cursor = mock.Mock()
|
||||
cursor.fetchone.return_value = (
|
||||
"Seq Scan on birth_names (cost=0.00..1537.91 rows=75691 width=46)",
|
||||
)
|
||||
sql = "SELECT * FROM birth_names"
|
||||
results = PostgresEngineSpec.estimate_statement_cost(sql, cursor)
|
||||
results = PostgresEngineSpec.estimate_statement_cost(database, sql, cursor)
|
||||
assert results == {"Start-up cost": 0.0, "Total cost": 1537.91}
|
||||
|
||||
def test_estimate_statement_invalid_syntax(self):
|
||||
@@ -165,6 +166,7 @@ class TestPostgresDbEngineSpec(TestDbEngineSpec):
|
||||
"""
|
||||
from psycopg2 import errors
|
||||
|
||||
database = mock.Mock()
|
||||
cursor = mock.Mock()
|
||||
cursor.execute.side_effect = errors.SyntaxError(
|
||||
"""
|
||||
@@ -175,7 +177,7 @@ class TestPostgresDbEngineSpec(TestDbEngineSpec):
|
||||
)
|
||||
sql = "DROP TABLE birth_names"
|
||||
with self.assertRaises(errors.SyntaxError):
|
||||
PostgresEngineSpec.estimate_statement_cost(sql, cursor)
|
||||
PostgresEngineSpec.estimate_statement_cost(database, sql, cursor)
|
||||
|
||||
def test_query_cost_formatter_example_costs(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user