dramis commented on issue #49887:
URL: https://github.com/apache/airflow/issues/49887#issuecomment-2864753569

   I apologize, but the issue is not related to the use of variables in the 
Jinja template. I ran a few tests on my side using a similar DAG and wasn't 
able to reproduce the issue initially. Then I reinstalled a fresh Airflow 3 
instance and added my DAGs one by one, which helped me identify the source of 
the problem.
   
   In some of my DAGs, I was using the following function to retrieve 
credentials from a connection, and passing the result to a BashOperator:
   
   ```
   # --- Utilities ---
   def _get_credential_from_conn(conn_id: str, **op_kwargs):
       conn = BaseHook.get_connection(conn_id)
       return f"-u {conn.login} -p {conn.password}"
   ```
   
   This worked fine in Airflow 2, but it seems to break in Airflow 3.
   
   I've since updated those DAGs to use variable in jinja template instead, and 
everything works properly.
   
   I can also confirm that I’m seeing the same behavior reported by @zachliu, 
even with just a single DAG using Variable.get() on a clean Airflow 3 instance.


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