From ceeb621416e95e0d3a3ef8ab4a758b85c1c2283c Mon Sep 17 00:00:00 2001 From: "ayush.tripathi" Date: Sat, 10 Aug 2024 18:54:07 +0530 Subject: [PATCH 1/9] Rename connector from 'couchbasedb' to 'couchbase' in documentation and db_engine_specs --- docs/docs/configuration/databases.mdx | 9 +++++---- .../db_engine_specs/{couchbasedb.py => couchbase.py} | 12 ++++++------ superset/sql_parse.py | 2 +- tests/unit_tests/db_engine_specs/test_couchbase.py | 12 ++++++------ 4 files changed, 18 insertions(+), 17 deletions(-) rename superset/db_engine_specs/{couchbasedb.py => couchbase.py} (97%) diff --git a/docs/docs/configuration/databases.mdx b/docs/docs/configuration/databases.mdx index 67734643b9b28..e7b5adb33e4f0 100644 --- a/docs/docs/configuration/databases.mdx +++ b/docs/docs/configuration/databases.mdx @@ -54,7 +54,7 @@ are compatible with Superset. | [Azure MS SQL](/docs/configuration/databases#sql-server) | `pip install pymssql` | `mssql+pymssql://UserName@presetSQL:TestPassword@presetSQL.database.windows.net:1433/TestSchema` | | [ClickHouse](/docs/configuration/databases#clickhouse) | `pip install clickhouse-connect` | `clickhousedb://{username}:{password}@{hostname}:{port}/{database}` | | [CockroachDB](/docs/configuration/databases#cockroachdb) | `pip install cockroachdb` | `cockroachdb://root@{hostname}:{port}/{database}?sslmode=disable` | -| [CouchbaseDB](/docs/configuration/databases#couchbaseDB) | `pip install couchbase-sqlalchemy` | `couchbasedb://{username}:{password}@{hostname}:{port}?truststorepath={ssl certificate path}` | +| [Couchbase](/docs/configuration/databases#couchbase) | `pip install couchbase-sqlalchemy` | `couchbase://{username}:{password}@{hostname}:{port}?truststorepath={ssl certificate path}` | | [Dremio](/docs/configuration/databases#dremio) | `pip install sqlalchemy_dremio` | `dremio://user:pwd@host:31010/` | | [Elasticsearch](/docs/configuration/databases#elasticsearch) | `pip install elasticsearch-dbapi` | `elasticsearch+http://{user}:{password}@{host}:9200/` | | [Exasol](/docs/configuration/databases#exasol) | `pip install sqlalchemy-exasol` | `exa+pyodbc://{username}:{password}@{hostname}:{port}/my_schema?CONNECTIONLCALL=en_US.UTF-8&driver=EXAODBC` | @@ -375,9 +375,10 @@ cockroachdb://root@{hostname}:{port}/{database}?sslmode=disable -#### CouchbaseDB +#### Couchbase -The recommended connector library for CouchbaseDB is +The Couchbase's Superset connection is designed to support two services: Couchbase Analytics and Couchbase Columnar. +The recommended connector library for is [couchbase-sqlalchemy](https://github.com/couchbase/couchbase-sqlalchemy). ``` pip install couchbase-sqlalchemy @@ -386,7 +387,7 @@ pip install couchbase-sqlalchemy The expected connection string is formatted as follows: ``` -couchbasedb://{username}:{password}@{hostname}:{port}?truststorepath={certificate path}?ssl={true/false} +couchbase://{username}:{password}@{hostname}:{port}?truststorepath={certificate path}?ssl={true/false} ``` diff --git a/superset/db_engine_specs/couchbasedb.py b/superset/db_engine_specs/couchbase.py similarity index 97% rename from superset/db_engine_specs/couchbasedb.py rename to superset/db_engine_specs/couchbase.py index 71dc7276791a1..5041ae651753d 100644 --- a/superset/db_engine_specs/couchbasedb.py +++ b/superset/db_engine_specs/couchbase.py @@ -74,14 +74,14 @@ class CouchbaseParametersSchema(Schema): ) -class CouchbaseDbEngineSpec(BasicParametersMixin, BaseEngineSpec): - engine = "couchbasedb" +class CouchbaseEngineSpec(BasicParametersMixin, BaseEngineSpec): + engine = "couchbase" engine_name = "Couchbase" - default_driver = "couchbasedb" + default_driver = "couchbase" allows_joins = False allows_subqueries = False sqlalchemy_uri_placeholder = ( - "couchbasedb://user:password@host[:port]?truststorepath=value?ssl=value" + "couchbase://user:password@host[:port]?truststorepath=value?ssl=value" ) parameters_schema = CouchbaseParametersSchema() @@ -128,7 +128,7 @@ def build_sqlalchemy_uri( if parameters.get("port") is None: uri = URL.create( - "couchbasedb", + "couchbase", username=parameters.get("username"), password=parameters.get("password"), host=parameters["host"], @@ -137,7 +137,7 @@ def build_sqlalchemy_uri( ) else: uri = URL.create( - "couchbasedb", + "couchbase", username=parameters.get("username"), password=parameters.get("password"), host=parameters["host"], diff --git a/superset/sql_parse.py b/superset/sql_parse.py index 05bf9b19bb84a..cf78431753935 100644 --- a/superset/sql_parse.py +++ b/superset/sql_parse.py @@ -102,7 +102,7 @@ "clickhouse": Dialects.CLICKHOUSE, "clickhousedb": Dialects.CLICKHOUSE, "cockroachdb": Dialects.POSTGRES, - "couchbasedb": Dialects.MYSQL, + "couchbase": Dialects.MYSQL, # "crate": ??? # "databend": ??? "databricks": Dialects.DATABRICKS, diff --git a/tests/unit_tests/db_engine_specs/test_couchbase.py b/tests/unit_tests/db_engine_specs/test_couchbase.py index 06a0c9a03882b..99e509db3acc6 100644 --- a/tests/unit_tests/db_engine_specs/test_couchbase.py +++ b/tests/unit_tests/db_engine_specs/test_couchbase.py @@ -33,18 +33,18 @@ def test_epoch_to_dttm() -> None: """ DB Eng Specs (couchbase): Test epoch to dttm """ - from superset.db_engine_specs.couchbasedb import CouchbaseDbEngineSpec + from superset.db_engine_specs.couchbase import CouchbaseEngineSpec - assert CouchbaseDbEngineSpec.epoch_to_dttm() == "MILLIS_TO_STR({col} * 1000)" + assert CouchbaseEngineSpec.epoch_to_dttm() == "MILLIS_TO_STR({col} * 1000)" def test_epoch_ms_to_dttm() -> None: """ DB Eng Specs (couchbase): Test epoch ms to dttm """ - from superset.db_engine_specs.couchbasedb import CouchbaseDbEngineSpec + from superset.db_engine_specs.couchbase import CouchbaseEngineSpec - assert CouchbaseDbEngineSpec.epoch_ms_to_dttm() == "MILLIS_TO_STR({col})" + assert CouchbaseEngineSpec.epoch_ms_to_dttm() == "MILLIS_TO_STR({col})" @pytest.mark.parametrize( @@ -62,7 +62,7 @@ def test_convert_dttm( expected_result: Optional[str], dttm: datetime, # noqa: F811 ) -> None: - from superset.db_engine_specs.couchbasedb import CouchbaseDbEngineSpec as spec + from superset.db_engine_specs.couchbase import CouchbaseEngineSpec as spec assert_convert_dttm(spec, target_type, expected_result, dttm) @@ -88,6 +88,6 @@ def test_get_column_spec( generic_type: GenericDataType, is_dttm: bool, ) -> None: - from superset.db_engine_specs.couchbasedb import CouchbaseDbEngineSpec as spec + from superset.db_engine_specs.couchbase import CouchbaseEngineSpec as spec assert_column_spec(spec, native_type, sqla_type, attrs, generic_type, is_dttm) From 135f16920cb51179bfc0dfd8a83ea7adee9aca21 Mon Sep 17 00:00:00 2001 From: "ayush.tripathi" Date: Sun, 11 Aug 2024 22:30:19 +0530 Subject: [PATCH 2/9] Updated alias to old name --- superset/sql_parse.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/superset/sql_parse.py b/superset/sql_parse.py index cf78431753935..79162ce0690b0 100644 --- a/superset/sql_parse.py +++ b/superset/sql_parse.py @@ -102,7 +102,8 @@ "clickhouse": Dialects.CLICKHOUSE, "clickhousedb": Dialects.CLICKHOUSE, "cockroachdb": Dialects.POSTGRES, - "couchbase": Dialects.MYSQL, + "couchbasedb": Dialects.MYSQL, + "couchbase": Dialects.MYSQL, # "crate": ??? # "databend": ??? "databricks": Dialects.DATABRICKS, From a892babb17e2db32f1dfc1ac31fd7dac79b78468 Mon Sep 17 00:00:00 2001 From: "ayush.tripathi" Date: Sun, 11 Aug 2024 22:30:19 +0530 Subject: [PATCH 3/9] Updated alias to old name --- superset/sql_parse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superset/sql_parse.py b/superset/sql_parse.py index 79162ce0690b0..c5cf4cea8acc2 100644 --- a/superset/sql_parse.py +++ b/superset/sql_parse.py @@ -103,7 +103,7 @@ "clickhousedb": Dialects.CLICKHOUSE, "cockroachdb": Dialects.POSTGRES, "couchbasedb": Dialects.MYSQL, - "couchbase": Dialects.MYSQL, + "couchbase": Dialects.MYSQL, # "crate": ??? # "databend": ??? "databricks": Dialects.DATABRICKS, From bf93aaf3128999636d9823d86207650234e06060 Mon Sep 17 00:00:00 2001 From: "ayush.tripathi" Date: Sun, 11 Aug 2024 22:30:19 +0530 Subject: [PATCH 4/9] Updated alias to old name --- superset/db_engine_specs/couchbase.py | 1 + superset/sql_parse.py | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/superset/db_engine_specs/couchbase.py b/superset/db_engine_specs/couchbase.py index 5041ae651753d..f42fb699bf90e 100644 --- a/superset/db_engine_specs/couchbase.py +++ b/superset/db_engine_specs/couchbase.py @@ -76,6 +76,7 @@ class CouchbaseParametersSchema(Schema): class CouchbaseEngineSpec(BasicParametersMixin, BaseEngineSpec): engine = "couchbase" + engine_aliases = {"couchbasedb"} engine_name = "Couchbase" default_driver = "couchbase" allows_joins = False diff --git a/superset/sql_parse.py b/superset/sql_parse.py index c5cf4cea8acc2..cf78431753935 100644 --- a/superset/sql_parse.py +++ b/superset/sql_parse.py @@ -102,7 +102,6 @@ "clickhouse": Dialects.CLICKHOUSE, "clickhousedb": Dialects.CLICKHOUSE, "cockroachdb": Dialects.POSTGRES, - "couchbasedb": Dialects.MYSQL, "couchbase": Dialects.MYSQL, # "crate": ??? # "databend": ??? From a6d889bd4327f10c3222494f47cfdb5d51d53a2c Mon Sep 17 00:00:00 2001 From: "ayush.tripathi" Date: Sun, 11 Aug 2024 22:30:19 +0530 Subject: [PATCH 5/9] Updated alias to old name --- superset/db_engine_specs/couchbase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superset/db_engine_specs/couchbase.py b/superset/db_engine_specs/couchbase.py index f42fb699bf90e..b96b48bd063a3 100644 --- a/superset/db_engine_specs/couchbase.py +++ b/superset/db_engine_specs/couchbase.py @@ -76,7 +76,7 @@ class CouchbaseParametersSchema(Schema): class CouchbaseEngineSpec(BasicParametersMixin, BaseEngineSpec): engine = "couchbase" - engine_aliases = {"couchbasedb"} + engine_aliases = {"couchbase", "couchbasedb"} engine_name = "Couchbase" default_driver = "couchbase" allows_joins = False From 8ade0e6e3ec56102c32fe12217a34d9acde36b5f Mon Sep 17 00:00:00 2001 From: "ayush.tripathi" Date: Mon, 12 Aug 2024 22:45:04 +0530 Subject: [PATCH 6/9] removing couchbase from engine_alias name --- superset/db_engine_specs/couchbase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superset/db_engine_specs/couchbase.py b/superset/db_engine_specs/couchbase.py index b96b48bd063a3..f42fb699bf90e 100644 --- a/superset/db_engine_specs/couchbase.py +++ b/superset/db_engine_specs/couchbase.py @@ -76,7 +76,7 @@ class CouchbaseParametersSchema(Schema): class CouchbaseEngineSpec(BasicParametersMixin, BaseEngineSpec): engine = "couchbase" - engine_aliases = {"couchbase", "couchbasedb"} + engine_aliases = {"couchbasedb"} engine_name = "Couchbase" default_driver = "couchbase" allows_joins = False From 8cf2d4f56b7f4896cce6da723590238f9670a611 Mon Sep 17 00:00:00 2001 From: "ayush.tripathi" Date: Mon, 12 Aug 2024 22:45:04 +0530 Subject: [PATCH 7/9] removing couchbase from engine_alias name --- docs/docs/configuration/databases.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/configuration/databases.mdx b/docs/docs/configuration/databases.mdx index e7b5adb33e4f0..8bae5491b1662 100644 --- a/docs/docs/configuration/databases.mdx +++ b/docs/docs/configuration/databases.mdx @@ -378,7 +378,7 @@ cockroachdb://root@{hostname}:{port}/{database}?sslmode=disable #### Couchbase The Couchbase's Superset connection is designed to support two services: Couchbase Analytics and Couchbase Columnar. -The recommended connector library for is +The recommended connector library for couchbase is [couchbase-sqlalchemy](https://github.com/couchbase/couchbase-sqlalchemy). ``` pip install couchbase-sqlalchemy From bfb6776f8d4ea23f96986e6d4cec919e5e629bdb Mon Sep 17 00:00:00 2001 From: "ayush.tripathi" Date: Mon, 12 Aug 2024 23:45:33 +0530 Subject: [PATCH 8/9] removed link to www.cnovit.com --- RESOURCES/INTHEWILD.md | 1 - 1 file changed, 1 deletion(-) diff --git a/RESOURCES/INTHEWILD.md b/RESOURCES/INTHEWILD.md index 692ad130efc2c..e79ffdcb9871f 100644 --- a/RESOURCES/INTHEWILD.md +++ b/RESOURCES/INTHEWILD.md @@ -80,7 +80,6 @@ Join our growing community! - [Caizin](https://caizin.com/) [@tejaskatariya] - [Careem](https://www.careem.com/) [@SamraHanifCareem] - [Cloudsmith](https://cloudsmith.io) [@alancarson] -- [CnOvit](http://www.cnovit.com/) [@xieshaohu] - [Cyberhaven](https://www.cyberhaven.com/) [@toliver-ch] - [Deepomatic](https://deepomatic.com/) [@Zanoellia] - [Dial Once](https://www.dial-once.com/) From 3d6682a619c346dd46178b09a95054b5264ee67f Mon Sep 17 00:00:00 2001 From: "ayush.tripathi" Date: Tue, 13 Aug 2024 10:06:04 +0530 Subject: [PATCH 9/9] putting cnovit link with https --- RESOURCES/INTHEWILD.md | 1 + 1 file changed, 1 insertion(+) diff --git a/RESOURCES/INTHEWILD.md b/RESOURCES/INTHEWILD.md index e79ffdcb9871f..ef1e1d7724b8d 100644 --- a/RESOURCES/INTHEWILD.md +++ b/RESOURCES/INTHEWILD.md @@ -80,6 +80,7 @@ Join our growing community! - [Caizin](https://caizin.com/) [@tejaskatariya] - [Careem](https://www.careem.com/) [@SamraHanifCareem] - [Cloudsmith](https://cloudsmith.io) [@alancarson] +- [CnOvit](https://www.cnovit.com/) [@xieshaohu] - [Cyberhaven](https://www.cyberhaven.com/) [@toliver-ch] - [Deepomatic](https://deepomatic.com/) [@Zanoellia] - [Dial Once](https://www.dial-once.com/)