cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
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

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.