Skip to content

feat: databricks allow disabling spark session#2703

Merged
eakmanrq merged 1 commit intomainfrom
eakmanrq/allow_disabling_databricks_spark_session
May 31, 2024
Merged

feat: databricks allow disabling spark session#2703
eakmanrq merged 1 commit intomainfrom
eakmanrq/allow_disabling_databricks_spark_session

Conversation

@eakmanrq
Copy link
Collaborator

@eakmanrq eakmanrq commented May 29, 2024

Prior to this change if a user was running in a databricks notebook we assumed they would want to use the local spark session. This isn't potentially the case though if the user wants to connect to new Serverless SQL from a notebook. So this change allows the user to disable spark session access so they can connect to Serverless SQL.

token=self._extra_config["databricks_connect_access_token"],
cluster_id=self._extra_config["databricks_connect_cluster_id"],
)
.userAgent("sqlmesh")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed this userAgent when I added support before.

@eakmanrq eakmanrq requested a review from a team May 29, 2024 22:49
| `databricks_connect_cluster_id` | Databricks Connect Only: Databricks Connect cluster ID. Uses `http_path` if not set. Cannot be a Databricks SQL Warehouse. | string | N |
| `force_databricks_connect` | When running locally, force the use of Databricks Connect for all model operations (so don't use SQL Connector for SQL models) | bool | N |
| `disable_databricks_connect` | When running locally, disable the use of Databricks Connect for all model operations (so use SQL Connector for all models) | bool | N |
| `disable_spark_session` | Do not use SparkSession if it is available (like when running in a notebook). | bool | N |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this feature allow you to not use SparkSession even if it is available, or it allows you to not get warnings when it's not available?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The former. So when running in a Databricks notebook you will always have a SparkSession available and this lets you say even though it is available you don't want to use it.

@eakmanrq eakmanrq merged commit e9c3c55 into main May 31, 2024
@eakmanrq eakmanrq deleted the eakmanrq/allow_disabling_databricks_spark_session branch May 31, 2024 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants