Skip to content

Commit

Permalink
fix: Redshift parameters not rendering (apache#14888)
Browse files Browse the repository at this point in the history
* Update redshift.py

* Update api_tests.py

* fixed test

* add file back
  • Loading branch information
hughhhh authored May 28, 2021
1 parent 507d4d7 commit 8f81fc0
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
1 change: 1 addition & 0 deletions superset/db_engine_specs/redshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -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...]"
Expand Down
41 changes: 40 additions & 1 deletion tests/databases/api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1506,10 +1506,49 @@ def test_available(self, app, get_available_engine_specs):
},
{
"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"],
Expand Down

0 comments on commit 8f81fc0

Please sign in to comment.