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:ย 

Unable to pass the task variables from Python Wheel to ForEach task

Divya_sreeE
New Contributor

I understand that task variables are supported in Databricks notebook , but there is a requirement from client to use python wheel package in Databricks workflow . We are not able to set the task variables using dbutils in python wheel file. Kindly suggest other alternatives to pass dynamic variables from the first python wheel task and use these variables in For Each as input.(Inside For each we have a 2nd python wheel task) 

1 REPLY 1

saurabh18cs
Valued Contributor III

Hi @Divya_sreeE 

you can pass dynamic variables between tasks using Databricks' job parameters.

1) In your first Python wheel task, generate the dynamic variables and use the Databricks REST API to update the job parameters.

2) In the For Each loop, retrieve the dynamic variables and pass them to the second Python wheel task.

   # Retrieve dynamic variables from job parameters
    dynamic_variable = os.getenv("DYNAMIC_VARIABLE")

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