Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly add databricks config to DatabricksSession #128

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading