Код: Выделить всё
import datetime
from airflow.decorators import dag, task
@task
def task_that_returns_a_string() -> str:
return "a string"
@task
def task_that_takes_a_string(arg: str) -> None:
print(arg)
@dag(
schedule_interval="@weekly",
start_date=datetime.datetime(2022, 1, 1),
)
def my_dag():
task_that_takes_a_string(task_that_returns_a_string())
my_dag()
Код: Выделить всё
Argument of type "XComArg" cannot be assigned to parameter "arg" of type "str"
"XComArg" is incompatible with "str"PylancereportArgumentType
Подробнее здесь: https://stackoverflow.com/questions/786 ... pe-hinting