apache / airflow

Apache Airflow - A platform to programmatically author, schedule, and monitor workflows
https://airflow.apache.org/
Apache License 2.0
35.33k stars 13.8k forks source link

mypy: Value of type "XComArg" is not indexable #39944

Open hterik opened 1 month ago

hterik commented 1 month ago

Apache Airflow version

2.9.1

If "Other Airflow 2 version" selected, which one?

No response

What happened?

  1. Try to make a DAG following the example on https://airflow.apache.org/docs/apache-airflow/2.9.1/core-concepts/taskflow.html#taskflow
  2. Run mypy in strict mode on this DAG (mypy version 1.10.0)
  3. mypy fails with error
    example.py:20 error: Value of type "XComArg" is not indexable  [index]
    example.py:21 error: Value of type "XComArg" is not indexable  [index]

What you think should happen instead?

Mypy should allow usage of XComArgs using multiple_outputs=True

How to reproduce

See above

Operating System

Ubuntu 24.04

Versions of Apache Airflow Providers

No response

Deployment

Other Docker-based deployment

Deployment details

No response

Anything else?

Possibly related to https://github.com/apache/airflow/issues/39514

Are you willing to submit PR?

Code of Conduct

RNHTTR commented 1 month ago

Can you try with mypy 1.9.0, which is what Airflow uses and is defined in constraints

hterik commented 1 month ago

Same error with mypy 1.9.0

github-actions[bot] commented 2 weeks ago

This issue has been automatically marked as stale because it has been open for 14 days with no response from the author. It will be closed in next 7 days if no further activity occurs from the issue author.