Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fetching username inside notebook in Databricks on high concurrency cluster?

Tags:

databricks

While trying to fetch user data on high concurrency cluster, I am facing this issue. I am using the command below to fetch the user details

dbutils.notebook.entry_point.getDbutils().notebook().getContext().tags().apply('user')

Below is the error log, for the run. Any help would be really appreciated.

Py4JError: An error occurred while calling o475.tags. Trace:
py4j.security.Py4JSecurityException: Method public scala.collection.immutable.Map com.databricks.backend.common.rpc.CommandContext.tags() is not whitelisted on class class com.databricks.backend.common.rpc.CommandContext
    at py4j.security.WhitelistingPy4JSecurityManager.checkCall(WhitelistingPy4JSecurityManager.java:409)
    at py4j.Gateway.invoke(Gateway.java:294)
    at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)
    at py4j.commands.CallCommand.execute(CallCommand.java:79)
    at py4j.GatewayConnection.run(GatewayConnection.java:251)
    at java.lang.Thread.run(Thread.java:748)
like image 242
Siddhant Jain Avatar asked Feb 01 '26 08:02

Siddhant Jain


1 Answers

You can retrieve the information by using dbutils command:

dbutils.notebook.entry_point.getDbutils().notebook().getContext().userName().get()
like image 77
Federico Raimondi Cominesi Avatar answered Feb 03 '26 23:02

Federico Raimondi Cominesi