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: 

Read task level parameters in python

DineshOjha
New Contributor II

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 ?

2 REPLIES 2

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 II

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

 

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group