cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

getContext() in dbutils.notebook not working in DBR 11.2 10.4 LTS Shared Mode It's also working in no isolation Mode in DBR 11.2

parthsalvi
Contributor

We are trying to fetch notebook context in our Job logging workflow.

current_context = dbutils.notebook.entry_point.getDbutils().notebook().getContext().toJson()

We were able to access this in DBR 10.4 custom mode but in DBR 10.4 & 11.2 (Shared Mode) we get the attached error.

Has the method to access notebook context change in newer DBR version or it's not available at all ?

image

2 REPLIES 2

Tjomme
New Contributor III

Same issue here. Tested on shared clusters up to the latest DBR version 13.1. All give the same error:

py4j.security.Py4JSecurityException: Method public java.lang.String com.databricks.backend.common.rpc.CommandContext.toJson() is not whitelisted on class class com.databricks.backend.common.rpc.CommandContext

With a Single user cluster there are no issues

Tjomme
New Contributor III

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group