board_databricks

board_databricks(path, versioned=True, cache=DEFAULT, allow_pickle_read=None)

Create a board to read and write pins from an Databricks Volume folder.

Parameters

Name Type Description Default
path The path to the target folder inside Unity Catalog. The path must include the catalog, schema, and volume names, preceded by ‘Volumes/’, for example: “/Volumes/my-catalog/my-schema/my-volume”. required
versioned Whether or not pins should be versioned. True
cache Whether to use a cache. By default, pins attempts to select the right cache directory, given your filesystem. If None is passed, then no cache will be used. You can set the cache using the PINS_CACHE_DIR environment variable. DEFAULT
allow_pickle_read Whether to allow reading pins that use the pickle protocol. Pickles are unsafe, and can execute arbitrary code. Only allow reading pickles if you trust the board to execute Python code on your computer. You can enable reading pickles by setting this to True, or by setting the environment variable PINS_ALLOW_PICKLE_READ. If both are set, this argument takes precedence. None

Notes

The Databricks board uses the databricks-sdk library to authenticate and interact with the Databricks Volume.

See https://docs.databricks.com/aws/en/dev-tools/sdk-python

Examples

>>> import pytest; pytest.skip()
>>> import pins
>>> from dotenv import load_dotenv
>>> load_dotenv() # eg, for a .env file with DATABRICKS_HOST and DATABRICKS_TOKEN set
>>> board = pins.board_databricks("/Volumes/examples/my-board/test-volume")
>>> board.pin_list()
['df_csv']
>>> board.pin_read("df_csv")
   x  y  z
0  1  a  3
1  2  b  4