You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "amcraig (via GitHub)" <gi...@apache.org> on 2025/10/21 22:53:08 UTC
[I] Airflow Incompatibility with Pylance/Pyright [airflow]
amcraig opened a new issue, #56990:
URL: https://github.com/apache/airflow/issues/56990
### Apache Airflow version
3.1.0
### If "Other Airflow 2/3 version" selected, which one?
This also occurs in 2.11
### What happened?
This drives me nuts, Pylance doesn't seem to be able to pick up correct stubs/typing for Airflow.
Ruff doesn't have issues with the code.
I have ensured VSCode is using the correct PythonPath for my Airflow project.
Common issues include:
- XCom typing between Tasks
- ObjectStoragePath and UPath type differences
- DAG operators `>>` are flagged as not being supported for the tasks
- Complains about unused values in DAG definitions
Is there anything I can do to alleviate this, or am I faced with just ignoring/turning off my linter for Airflow development?
Here's an example DAG which throws Pylance linting error:
<img width="872" height="826" alt="Image" src="https://github.com/user-attachments/assets/1a0a6558-c1af-4110-8731-33136507d1da" />
### What you think should happen instead?
I'd expect that Airflow should work nicely with Pylance/Pyright.
### How to reproduce
Just create a simple DAG like the one in the screenshot provided using ObjectStorage.
An easy linting error is to reproduce is to return a ObjectStoragePath from one task and consume that same ObjectStoragePath in the next task.
The Type of the ObjectStoragePath seems to be lost after passing through XComs
### Operating System
MacOS
### Versions of Apache Airflow Providers
apache-airflow-providers-google==18.0.0
apache-airflow-providers-standard==1.8.0
### Deployment
Virtualenv installation
### Deployment details
This is just experienced in local dev
### 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: commits-unsubscribe@airflow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Airflow Incompatibility with Pylance/Pyright [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk closed issue #56990: Airflow Incompatibility with Pylance/Pyright
URL: https://github.com/apache/airflow/issues/56990
--
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
Re: [I] Airflow Incompatibility with Pylance/Pyright [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on issue #56990:
URL: https://github.com/apache/airflow/issues/56990#issuecomment-3431168557
Use Mypy instead. This is what we use, check and run in our CI.
There is a Mypy VS Code extension as far as I know that uses MyPy Daemon.
We have MyPy plugins that support those "Airflow" things - this is why it works nicer (despite all the MyPy shortcomings). And last time we checked MyPy is the only one that support plugins that allow us to implement some of the checks you mentioned. We spoke to both PyRefly (Facebook) and Ty (Astral) teams and while PyRefly team is kinda open to add plugins in the near fuiture, Ty will not have plugins for quite long time after it is out of beta.
But If you have other ways, it would be great to contribute it. We are also looking towards ty, pyrefly as replacements for mypy - but lack of plugin support that would allow us to make those things work made it so far not very appealing despite the speed. However maybe things changes - if you would like to invest in Pyrefly or Ty replacement, that would be a good contribution - both of them fully suport Language Server Specification so should nicely fit VSCode.
I believe - unfortunately - pyright does not support plugins, otherwise we would also welcome someone who really wants to use pyright to contribute plugins to support those things.
--
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
Re: [I] Airflow Incompatibility with Pylance/Pyright [airflow]
Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on issue #56990:
URL: https://github.com/apache/airflow/issues/56990#issuecomment-3429846899
Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.
--
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