Skip to content

Commit

Permalink
fix: Rename database from 'couchbasedb' to 'couchbase' in documentati…
Browse files Browse the repository at this point in the history
…on and db_engine_specs (#29911)

(cherry picked from commit f5d614d)
  • Loading branch information
ayush-couchbase authored and sadpandajoe committed Nov 13, 2024
1 parent 7953c89 commit 29c76ef
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 17 deletions.
15 changes: 14 additions & 1 deletion RESOURCES/INTHEWILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ all you have to do is file a simple PR [like this one](https://github.com/apache
the categorization is inaccurate, please file a PR with your correction as well.
Join our growing community!


### Sharing Economy

- [Airbnb](https://github.com/airbnb)
- [Faasos](http://faasos.com/) [@shashanksingh]
- [Hostnfly](https://www.hostnfly.com/) [@alexisrosuel]
Expand All @@ -35,6 +35,7 @@ Join our growing community!
- [Ontruck](https://www.ontruck.com/)

### Financial Services

- [Aktia Bank plc](https://www.aktia.com) [@villebro]
- [American Express](https://www.americanexpress.com) [@TheLastSultan]
- [Cape Crypto](https://capecrypto.com)
Expand All @@ -47,9 +48,11 @@ Join our growing community!
- [bumper](https://www.bumper.co/) [@vasu-ram, @JamiePercival]

### Gaming

- [Popoko VM Games Studio](https://popoko.live)

### E-Commerce

- [AiHello](https://www.aihello.com) [@ganeshkrishnan1]
- [Bazaar Technologies](https://www.bazaartech.com) [@umair-abro]
- [Dragonpass](https://www.dragonpass.com.cn/) [@zhxjdwh]
Expand All @@ -71,6 +74,7 @@ Join our growing community!
- [Zalora](https://www.zalora.com) [@ksaagariconic]

### Enterprise Technology

- [A3Data](https://a3data.com.br) [@neylsoncrepalde]
- [Analytics Aura](https://analyticsaura.com/) [@Analytics-Aura]
- [Apollo GraphQL](https://www.apollographql.com/) [@evans]
Expand All @@ -79,6 +83,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/)
Expand Down Expand Up @@ -119,6 +124,7 @@ Join our growing community!
- [Zeta](https://www.zeta.tech/) [@shaikidris]

### Media & Entertainment

- [6play](https://www.6play.fr) [@CoryChaplin]
- [bilibili](https://www.bilibili.com) [@Moinheart]
- [BurdaForward](https://www.burda-forward.de/en/)
Expand All @@ -131,6 +137,7 @@ Join our growing community!
- [Zaihang](http://www.zaih.com/)

### Education

- [Aveti Learning](https://avetilearning.com/) [@TheShubhendra]
- [Brilliant.org](https://brilliant.org/)
- [Platzi.com](https://platzi.com/)
Expand All @@ -141,13 +148,15 @@ Join our growing community!
- [WikiMedia Foundation](https://wikimediafoundation.org) [@vg]

### Energy

- [Airboxlab](https://foobot.io) [@antoine-galataud]
- [DouroECI](https://www.douroeci.com/) [@nunohelibeires]
- [Safaricom](https://www.safaricom.co.ke/) [@mmutiso]
- [Scoot](https://scoot.co/) [@haaspt]
- [Wattbewerb](https://wattbewerb.de/) [@wattbewerb]

### Healthcare

- [Amino](https://amino.com) [@shkr]
- [Bluesquare](https://www.bluesquarehub.com/) [@madewulf]
- [Care](https://www.getcare.io/)[@alandao2021]
Expand All @@ -159,19 +168,23 @@ Join our growing community!
- [WeSure](https://www.wesure.cn/)

### HR / Staffing

- [Swile](https://www.swile.co/) [@PaoloTerzi]
- [Symmetrics](https://www.symmetrics.fyi)
- [bluquist](https://bluquist.com/)

### Government

- [City of Ann Arbor, MI](https://www.a2gov.org/) [@sfirke]
- [RIS3 Strategy of CZ, MIT CR](https://www.ris3.cz/) [@RIS3CZ]

### Travel

- [Agoda](https://www.agoda.com/) [@lostseaway, @maiake, @obombayo]
- [Skyscanner](https://www.skyscanner.net/) [@cleslie, @stanhoucke]

### Others

- [10Web](https://10web.io/)
- [AI inside](https://inside.ai/en/)
- [Automattic](https://automattic.com/) [@Khrol, @Usiel]
Expand Down
9 changes: 5 additions & 4 deletions docs/docs/configuration/databases.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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` |
Expand Down Expand Up @@ -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 couchbase is
[couchbase-sqlalchemy](https://github.com/couchbase/couchbase-sqlalchemy).
```
pip install couchbase-sqlalchemy
Expand All @@ -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}
```


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,15 @@ class CouchbaseParametersSchema(Schema):
)


class CouchbaseDbEngineSpec(BasicParametersMixin, BaseEngineSpec):
engine = "couchbasedb"
class CouchbaseEngineSpec(BasicParametersMixin, BaseEngineSpec):
engine = "couchbase"
engine_aliases = {"couchbasedb"}
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()

Expand Down Expand Up @@ -128,7 +129,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"],
Expand All @@ -137,7 +138,7 @@ def build_sqlalchemy_uri(
)
else:
uri = URL.create(
"couchbasedb",
"couchbase",
username=parameters.get("username"),
password=parameters.get("password"),
host=parameters["host"],
Expand Down
12 changes: 6 additions & 6 deletions tests/unit_tests/db_engine_specs/test_couchbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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)

Expand All @@ -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)

0 comments on commit 29c76ef

Please sign in to comment.