Read task level parameters in python

DineshOjha
New Contributor III

I am creating Databricks jobs and tasks using a python package. I have defined a task level parameter and would like to reference it in my script using sys.argv. How can I do that ?

brockb
Databricks Employee
Databricks Employee

Hi @DineshOjha ,

You can reference the task-level parameters using `my_python_var = dbutils.widgets.get('my-task-level-param')`.

More information on task values can be found here: https://docs.databricks.com/en/jobs/task-values.html#set-task-values.

Hope this helps.

DineshOjha
New Contributor III

Thanks, but the link works for notebook. I have a python package run as python wheel and am wondering how to access the parameters. When I run the job its not able to understand the task level parameters in sys.argv