A simple util to get a spark and mlflow session objects from an .env file
Project description
Databricks Session Util
A simple utility for spark and mlflow session objects
Setup
Quick Install
python -m pip install databricks_session
Build from source
Clone the repository
git clone https://github.com/Broomva/databricks_session.git
Install the package
cd databricks_session && make install
Build manually
After cloning, create a virtual environment
conda create -n databricks_session python=3.10
conda activate databricks_session
Install the requirements
pip install -r requirements.txt
Run the python installation
python setup.py install
Usage
The deployment requires a .env file created under local folder:
touch .env
It should have a schema like this:
databricks_experiment_name=''
databricks_experiment_id=''
databricks_host=''
databricks_token=''
databricks_username=''
databricks_password=''
databricks_cluster_id=''
import databricks_session
# Create a Snowpark session
spark = DatabricksSparkSession().get_session()
# Connect to MLFLow Artifact Server
mlflow_session = DatabricksMLFlowSession().get_session()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
databricks_session-0.0.2.tar.gz
(13.1 kB
view hashes)
Built Distribution
Close
Hashes for databricks_session-0.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 600d1a43d290c5c06654be13a90ed76c5ee05f7e7207691f0c8f762305e8a1d0 |
|
MD5 | db61bf1283e5fa38b23a28b9a1556171 |
|
BLAKE2b-256 | 84daa08165f87b1683d4118cc5d70ead3051b9b2f9ae9920dfe2baf612a7f27b |