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
Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!