04-30-2025 02:20 AM
I am trying to execute pandas UDF in databricks. It gives me the following error on serverless compute,
File /local_disk0/.ephemeral_nfs/envs/pythonEnv-b11ff17c-9b25-4ccb-927d-06a7d1ca7221/lib/python3.11/site-packages/pyspark/sql/connect/client/core.py:2340, in SparkConnectClient._handle_rpc_error(self, rpc_error) 2325 raise Exception( 2326 "Python versions in the Spark Connect client and server are different. " 2327 "To execute user-defined functions, client and server should have the " (...) 2336 "https://docs.databricks.com/en/release-notes/serverless.html" target="_blank" rel="noopener noreferrer">https://docs.databricks.com/en/release-notes/serverless.html</a>.</span><span class="ansi-yellow-fg">"
As far as I am aware, I cannot change the python version of the client in serverless. Are there any ways to fix this issue from my side?
3 weeks ago
@chinmay0924 - You can change the serverless client image by selecting the environment panel in a Databricks Notebook (on the right pane) or in the "Environment and Libraries" section while configuring a Databricks Job Task.
The set of available serverless client images (officially called Serverless environment versions is here https://docs.databricks.com/aws/en/release-notes/serverless/environment-version/
In the case of Databricks Connect, upgrade to DB Connect 15.4.10 or later (on the 15.x line) or 16.4.1 (on the 16.x line). The reported issue has been fixed in these versions. The compatible Python version on 15.4.10 (or later) is Python 3.11, and on 16.4.1 (or later), it is Python 3.12.
More details can be found here: https://docs.databricks.com/aws/en/dev-tools/databricks-connect/requirements#databricks-connect-vers...
04-30-2025 06:56 AM
Correct, you cannot alter any pre-installed libraries on Serverless. Have you considered changing your client side Python to align with the version running on the Serverless cluster?
05-01-2025 11:21 PM
If I am using the databricks notebook with serverless attached, how do I change the client side python? I have control over client side python if I use databricks connect from my local setup, but is there a way to change the client side python version from databricks itself?
05-02-2025 04:42 AM
05-06-2025 11:07 PM
Thanks a lot for the reply! Final question: Is it possible for the end user to select a serverless client image version or is that not something that I can choose? If so, how? I couldn't find any documentation regarding this.
05-07-2025 04:19 AM
Serverless is management free which means you cannot choose the image. Hope this helps. Lou.
3 weeks ago
@chinmay0924 - You can change the serverless client image by selecting the environment panel in a Databricks Notebook (on the right pane) or in the "Environment and Libraries" section while configuring a Databricks Job Task.
The set of available serverless client images (officially called Serverless environment versions is here https://docs.databricks.com/aws/en/release-notes/serverless/environment-version/
In the case of Databricks Connect, upgrade to DB Connect 15.4.10 or later (on the 15.x line) or 16.4.1 (on the 16.x line). The reported issue has been fixed in these versions. The compatible Python version on 15.4.10 (or later) is Python 3.11, and on 16.4.1 (or later), it is Python 3.12.
More details can be found here: https://docs.databricks.com/aws/en/dev-tools/databricks-connect/requirements#databricks-connect-vers...
Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!
Sign Up Now