prefect_databricks.credentials
¶
Credential classes used to perform authenticated interactions with Databricks
DatabricksCredentials
¶
Bases: Block
Block used to manage Databricks authentication.
Attributes:
Name | Type | Description |
---|---|---|
databricks_instance |
str
|
Databricks instance used in formatting the endpoint URL. |
token |
SecretStr
|
The token to authenticate with Databricks. |
client_kwargs |
Optional[Dict[str, Any]]
|
Additional keyword arguments to pass to AsyncClient. |
Examples:
Load stored Databricks credentials:
from prefect_databricks import DatabricksCredentials
databricks_credentials_block = DatabricksCredentials.load("BLOCK_NAME")
Source code in prefect_databricks/credentials.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
|
get_client
¶
Gets an Databricks REST AsyncClient.
Returns:
Type | Description |
---|---|
AsyncClient
|
An Databricks REST AsyncClient. |
Example
Gets a Databricks REST AsyncClient.
from prefect import flow
from prefect_databricks import DatabricksCredentials
@flow
def example_get_client_flow():
token = "consumer_key"
databricks_credentials = DatabricksCredentials(token=token)
client = databricks_credentials.get_client()
return client
example_get_client_flow()
Source code in prefect_databricks/credentials.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
|