This is an automated email from the ASF dual-hosted git repository.
beto pushed a commit to branch db-diagnostics
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/db-diagnostics by this push:
new 2e96b512dd WIP
2e96b512dd is described below
commit 2e96b512dd75108514f05f109bf22c2a823d46c1
Author: Beto Dealmeida <[email protected]>
AuthorDate: Tue Jul 25 14:23:16 2023 -0700
WIP
---
superset/cli/test_db.py | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/superset/cli/test_db.py b/superset/cli/test_db.py
index 9673a85599..30be55bcb9 100644
--- a/superset/cli/test_db.py
+++ b/superset/cli/test_db.py
@@ -278,6 +278,9 @@ def test_sqlalchemy_dialect(
def test_database_connectivity(console: Console, engine: Engine) -> None:
+ """
+ Tests the DB API 2.0 driver.
+ """
with console.status("[bold green]Connecting to database..."):
try:
conn = engine.raw_connection()
@@ -287,3 +290,15 @@ def test_database_connectivity(console: Console, engine:
Engine) -> None:
console.print(f":thumbs_down: [red]Failed to connect: {ex}")
console.print("[bold]Exiting...")
sys.exit(1)
+
+ cursor = conn.cursor()
+
+ console.print("[bold]Checking that we can run queries...")
+ console.print("sql> SELECT 1;")
+ cursor.execute("SELECT 1")
+ result = cursor.fetchone()[0]
+ color = "green" if result == 1 else "red"
+ console.print(f"[{color}]> {result}")
+
+ # TODO(betodealmeida): create tables with different types and test them
+ # TODO(betodealmeida): run DB-specific tests