atoti_directquery_databricks.connection_info module#
- class atoti_directquery_databricks.DatabricksConnectionInfo#
Information needed to connect to a Databricks database.
- __init__(url, /, *, password=None, time_travel='strict')#
Create a Databricks connection info.
- Parameters:
url (str) – The JDBC connection string.
password (str | None) –
The password to connect to the database.
Passing it in this separate parameter allows to avoid having it logged alongside the connection string.
If
None
, a password is expected to be present in the passed url.time_travel (Literal[False, 'lax', 'strict']) –
How to use Databricks’ time travel feature.
Databricks does not support time travel with views, so the options are: -
False
: tables and views are queried on the latest state of the database. -"lax"
: tables are queried with time travel but views are queried without it. -"strict"
: tables are queried with time travel and querying a view raises an error.
Example
>>> import os >>> from atoti_directquery_databricks import DatabricksConnectionInfo >>> connection_info = DatabricksConnectionInfo( ... "jdbc:databricks://" ... + os.environ["DATABRICKS_SERVER_HOSTNAME"] ... + "/default;" ... + "transportMode=http;" ... + "ssl=1;" ... + "httpPath=" ... + os.environ["DATABRICKS_HTTP_PATH"] ... + ";" ... + "AuthMech=3;" ... + "UID=token;", ... password=os.environ["DATABRICKS_AUTH_TOKEN"], ... )