- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2023 05:47 AM
@haiderpasha mohammed : Okay, let me give you some more work arounds. Please let me know if that helps.
The error message suggests that the toJson() method of the CommandContext class is not whitelisted for use in Shared Unity Catalog mode. This could be due to security restrictions on the shared environment. To work around this issue, you can try accessing the context information in a different way. Instead of using
toJson() , you could try accessing the relevant information directly from the context object. For example, if you want to access the notebook ID, you could try the following code:
print(dbutils.entry_point.getDbutils().notebook().getContext().notebookId().get())This code should return the ID of the current notebook. You can replace
notebookId() with other methods to access different properties of the context object. If this workaround does not work, lets think of more options.