From 8f81fc0ad72b2332ba89463a09e619d79e483c46 Mon Sep 17 00:00:00 2001 From: "Hugh A. Miles II" Date: Fri, 28 May 2021 12:57:15 -0400 Subject: [PATCH] fix: Redshift parameters not rendering (#14888) * Update redshift.py * Update api_tests.py * fixed test * add file back --- superset/db_engine_specs/redshift.py | 1 + tests/databases/api_tests.py | 41 +++++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/superset/db_engine_specs/redshift.py b/superset/db_engine_specs/redshift.py index beff1f694..6b7900752 100644 --- a/superset/db_engine_specs/redshift.py +++ b/superset/db_engine_specs/redshift.py @@ -50,6 +50,7 @@ class RedshiftEngineSpec(PostgresBaseEngineSpec, BasicParametersMixin): engine = "redshift" engine_name = "Amazon Redshift" max_column_name_length = 127 + default_driver = "psycopg2" sqlalchemy_uri_placeholder = ( "redshift+psycopg2://user:password@host:port/dbname[?key=value&key=value...]" diff --git a/tests/databases/api_tests.py b/tests/databases/api_tests.py index 09711fd98..fad93ade8 100644 --- a/tests/databases/api_tests.py +++ b/tests/databases/api_tests.py @@ -1506,10 +1506,49 @@ class TestDatabaseApi(SupersetTestCase): }, { "available_drivers": ["psycopg2"], - "default_driver": "", + "default_driver": "psycopg2", "engine": "redshift", "name": "Amazon Redshift", + "parameters": { + "properties": { + "database": { + "description": "Database name", + "type": "string", + }, + "encryption": { + "description": "Use an encrypted connection to the database", + "type": "boolean", + }, + "host": { + "description": "Hostname or IP address", + "type": "string", + }, + "password": { + "description": "Password", + "nullable": True, + "type": "string", + }, + "port": { + "description": "Database port", + "format": "int32", + "type": "integer", + }, + "query": { + "additionalProperties": {}, + "description": "Additional parameters", + "type": "object", + }, + "username": { + "description": "Username", + "nullable": True, + "type": "string", + }, + }, + "required": ["database", "host", "port", "username"], + "type": "object", + }, "preferred": False, + "sqlalchemy_uri_placeholder": "redshift+psycopg2://user:password@host:port/dbname[?key=value&key=value...]", }, { "available_drivers": ["mysqlconnector", "mysqldb"],