komjera opened a new issue, #62945:
URL: https://github.com/apache/airflow/issues/62945

   ### Apache Airflow version
   
   3.1.7
   
   ### If "Other Airflow 3 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   Received warning 
   ```log
   Cannot infer multiple_outputs for TaskFlow function 'dataframe_task' with 
forward type references that are not imported. (Error was name 'DataFrame' is 
not defined) category=UserWarning
   ```
   when using quotes when typehinting with a type that is only imported during 
TYPE_CHECKING.
   
   ### What you think should happen instead?
   
   There should be no warning
   
   ### How to reproduce
   
   ```py
   from typing import TYPE_CHECKING
   
   from airflow.sdk import dag, task
   
   if TYPE_CHECKING:
       from pandas import DataFrame
   
   
   @task(task_id="df_task")
   def dataframe_task() -> "DataFrame":
       import pandas as pd
   
       df = pd.DataFrame({"a": [1, 2, 3]})
       return df
   
   
   @dag()
   def simple_dag():
       _ = dataframe_task()
   
   
   simple_dag()
   ```
   
   ### Operating System
   
   Debian GNU/Linux 12 (bookworm)
   
   ### Versions of Apache Airflow Providers
   
   apache-airflow-providers-standard==1.11.0
   apache-airflow-providers-common-sql==1.30.4
   apache-airflow-providers-microsoft-azure==12.10.3
   apache-airflow-providers-microsoft-mssql==4.4.1
   
   ### Deployment
   
   Astronomer
   
   ### Deployment details
   
   Running locally using astro CLI and image 
astrocrpublic.azurecr.io/runtime:3.1-13-python-3.12
   
   ### 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