atul-astronomer opened a new issue, #48433:
URL: https://github.com/apache/airflow/issues/48433

   ### Apache Airflow version
   
   main (development)
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   airflow tasks render test_api_dag test_task 
manual__2025-03-27T08:20:17.114599+00:00_cNx08o6u
   Traceback (most recent call last):
     File "/usr/local/bin/airflow", line 10, in <module>
       sys.exit(main())
     File "/opt/airflow/airflow-core/src/airflow/__main__.py", line 58, in main
       args.func(args)
     File "/opt/airflow/airflow-core/src/airflow/cli/cli_config.py", line 49, 
in command
       return func(*args, **kwargs)
     File "/opt/airflow/airflow-core/src/airflow/utils/cli.py", line 111, in 
wrapper
       return f(*args, **kwargs)
     File "/opt/airflow/airflow-core/src/airflow/utils/cli.py", line 398, in 
_wrapper
       f(*args, **kwargs)
     File 
"/opt/airflow/airflow-core/src/airflow/utils/providers_configuration_loader.py",
 line 55, in wrapped_function
       return func(*args, **kwargs)
     File "/opt/airflow/airflow-core/src/airflow/cli/commands/task_command.py", 
line 427, in task_render
       ti, _ = _get_ti(
     File "/opt/airflow/airflow-core/src/airflow/utils/session.py", line 101, 
in wrapper
       return func(*args, session=session, **kwargs)
     File "/opt/airflow/airflow-core/src/airflow/cli/commands/task_command.py", 
line 165, in _get_ti
       raise ValueError(
   ValueError: We need a airflow.models.dag.DAG, but we got 
airflow.sdk.definitions.dag.DAG!
   
   ### What you think should happen instead?
   
   _No response_
   
   ### How to reproduce
   
   Have a dag where DAG is imported from airflow.sdk and run TI render CLI 
command
   
   CLI command: **airflow tasks render <dag_id> <test_id> <run_id>** 
   
   ```python
   from datetime import datetime
   
   from airflow.providers.standard.operators.bash import BashOperator
   from airflow.sdk import DAG
   
   dag = DAG(
       'test_api_dag',
       start_date=datetime(2025, 3, 1, 3, 28, 0),
       schedule='@daily',
       is_paused_upon_creation=False
   )
   
   hello_task = BashOperator(
       task_id='test_task',
       bash_command='echo "Hello World from Airflow!"',
       do_xcom_push = True,
       dag=dag,
   )
   
   hello_task
   
   ``` 
   
   ### Operating System
   
   Linux
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Other
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


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