Skip to content

Commit

Permalink
Merge pull request #125 from nrccua/DS-479-avoid-instantiating-spark-…
Browse files Browse the repository at this point in the history
…if-databricks-connect-in

Avoid instantiating spark if databricks-connect installed
  • Loading branch information
nrccua-timr authored Mar 12, 2024
2 parents 0951e40 + c2843ee commit 1a4eb3e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 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.12 (2024-03-12)

* Avoid instantiating spark if databricks-connect installed.


v0.20.11 (2024-03-12)

* Add pyspark back in as install requirement.
Expand Down
7 changes: 6 additions & 1 deletion aioradio/ds_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
# pylint: disable=too-many-boolean-expressions
# pylint: disable=unnecessary-comprehension
# pylint: disable=unused-argument
# pylint: disable=unused-import
# pylint: disable=used-before-assignment

import base64
import csv
Expand Down Expand Up @@ -46,7 +48,10 @@
c_handler.setFormatter(c_format)
logger.addHandler(c_handler)

spark = SparkSession.builder.getOrCreate()
try:
from databricks.connect import DatabricksSession
except ImportError:
spark = SparkSession.builder.getOrCreate()


############################### Databricks functions ################################
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.11',
version='0.20.12',
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 1a4eb3e

Please sign in to comment.