gopidesupavan commented on issue #54223:
URL: https://github.com/apache/airflow/issues/54223#issuecomment-3173941987

   it must be setup issue on your side it looks like i am not able reproduce, i 
ran this example its working
   
   
   
   ```
   from airflow.sdk import dag, Param
   
   from airflow.sdk import task
   @task.virtualenv(
       system_site_packages = False,
       venv_cache_path="venvs/test",
       inherit_env = True
   )
   def virtual_task(variables:dict, logical_date = None, params = None):
       print(variables)
       print(f"This is param: {params} !!!!!")
       print(f"This is logical_date: {logical_date} !!!!!")
       return
   
   @task(task_id="load_vars_for_venv")
   def load_vars_for_venv(var_list:list):
       from airflow.sdk import Variable
       variables = {}
       for variable in var_list:
           variables[variable] = Variable.get(variable)
       return variables
   
   @dag(
       dag_id="test",
       params={
           "P": Param("HI", type="string")
       }
   )
   def test():
   
       variables = load_vars_for_venv(var_list=["DATASETTE_DB_SECRET"])
       virtual_task(variables=variables)
   
   test()
   
   ```
   
   Whats the easises and simple way to reproduce your behaviour?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to