You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "josh-fell (via GitHub)" <gi...@apache.org> on 2023/02/09 14:46:31 UTC

[GitHub] [airflow] josh-fell commented on issue #29435: TaskFlow API `multiple_outputs` inferral causes import errors when using PEP 563 and TYPE_CHECKING

josh-fell commented on issue #29435:
URL: https://github.com/apache/airflow/issues/29435#issuecomment-1424305225

   Actually this looks like an issue even if you don't use PEP 563 and have stringified typing:
   ```python
   # from __future__ import annotations
   
   from typing import TYPE_CHECKING, Any
   
   from pendulum import datetime
   
   from airflow.decorators import dag, task
   
   if TYPE_CHECKING:
       from pandas import DataFrame
   
   
   @dag(start_date=datetime(2023, 1, 1), schedule=None)
   def multiple_outputs():
       @task()
       def transform(df: "DataFrame" = None) -> dict[str, Any]:
           ...
   
       transform()
   
   multiple_outputs()
   ```
   Same `NameError` when parsing the DAG.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org