diff --git a/toucan_connectors/databricks/databricks_connector.py b/toucan_connectors/databricks/databricks_connector.py index 7ab0d1576..5a8ccbd59 100644 --- a/toucan_connectors/databricks/databricks_connector.py +++ b/toucan_connectors/databricks/databricks_connector.py @@ -34,8 +34,15 @@ class DatabricksConnector(ToucanConnector): http_path: str = Field( ..., description='Databricks compute resources URL', placeholder='sql/protocolv1/o/xxx/yyy' ) + user: str | None = Field( + 'token', + description='"token" if you use a personal access token, or username if you connect by username/password', + placeholder='token', + ) pwd: SecretStr = Field( - None, description='Your personal access token', placeholder='dapixxxxxxxxxxx' + ..., + description='Your personal access token, or password if you connect by username/password', + placeholder='dapixxxxxxxxxxx', ) ansi: bool = False on_demand: bool = Field( @@ -53,7 +60,7 @@ def _build_connection_string(self) -> str: 'ThriftTransport': 2, 'SSL': 1, 'AuthMech': 3, - 'UID': 'token', + 'UID': self.user if self.user is not None else 'token', 'PWD': self.pwd.get_secret_value(), } return ';'.join(f'{k}={v}' for k, v in connection_params.items() if v is not None) diff --git a/toucan_connectors/install_scripts/databricks.sh b/toucan_connectors/install_scripts/databricks.sh index 0d418d80e..71f00928f 100755 --- a/toucan_connectors/install_scripts/databricks.sh +++ b/toucan_connectors/install_scripts/databricks.sh @@ -9,11 +9,10 @@ fi apt-get update apt-get install -fyq libsasl2-modules-gssapi-mit wget unzip mkdir -p /tmp/databricks -# The next link was extracted from an email received after -# filling: https://databricks.com/spark/odbc-driver-download -wget 'https://public-package.toucantoco.com/connectors_sources/databricks/SimbaSparkODBC-2.6.4.1004-Debian-64bit.zip' \ +# This package was downloaded from https://www.databricks.com/spark/odbc-drivers-download +wget 'https://public-package.toucantoco.com/connectors_sources/databricks/SimbaSparkODBC-2.7.5.1012-Debian-64bit.zip' \ -O /tmp/databricks/simbaspark.zip unzip /tmp/databricks/simbaspark.zip -d /tmp/databricks -dpkg -i /tmp/databricks/SimbaSparkODBC-2.6.4.1004-Debian-64bit/simbaspark_2.6.4.1004-2_amd64.deb +dpkg -i /tmp/databricks/simbaspark_2.7.5.1012-2_amd64.deb rm -rf /tmp/databricks touch ~/databricks-installed