Skip to content

Commit

Permalink
Merge pull request #128 from nrccua/DS-482-explicitly-add-databricks-…
Browse files Browse the repository at this point in the history
…config-to-databrickssess

Explicitly add databricks config to DatabricksSession
  • Loading branch information
nrccua-timr authored Mar 16, 2024
2 parents d74001d + dda28e5 commit 08a439f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ History
=======


v0.20.15 (2024-03-16)

* Explicitly add databricks config to DatabricksSession.


v0.20.14 (2024-03-15)

* Fix bug with spark not being instantiated.
Expand Down
8 changes: 6 additions & 2 deletions aioradio/ds_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,12 @@

try:
from databricks.connect import DatabricksSession
spark = DatabricksSession.builder.getOrCreate()
except ImportError:
spark = DatabricksSession.builder.remote(
host=os.environ['DATABRICKS_HOST'],
token=os.environ['DATABRICKS_TOKEN'],
cluster_id=os.environ['DATABRICKS_CLUSTER_ID']
).getOrCreate()
except Exception:
spark = SparkSession.builder.getOrCreate()


Expand Down
1 change: 1 addition & 0 deletions aioradio/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ backoff==2.2.1
boto3==1.34.34
botocore==1.34.34
cython==3.0.8
databricks-connect==14.3.1
ddtrace==2.6.5
dominodatalab==1.3.0
fakeredis==2.21.1
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
long_description = fileobj.read()

setup(name='aioradio',
version='0.20.14',
version='0.20.15',
description='Generic asynchronous i/o python utilities for AWS services (SQS, S3, DynamoDB, Secrets Manager), Redis, MSSQL (pyodbc), JIRA and more',
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 08a439f

Please sign in to comment.