barking-code opened a new issue, #40617:
URL: https://github.com/apache/airflow/issues/40617

   ### Apache Airflow version
   
   Other Airflow 2 version (please specify below)
   
   ### If "Other Airflow 2 version" selected, which one?
   
   2.9.0
   
   ### What happened?
   
   After updating to Airflow 2.9.0 from 2.6.2, I met a mypy error like the one 
below.
   `Incompatible types in assignment (expression has type "Column[Integer]", 
variable has type "int")`
   
   So, I tested some simple code, it raised the same error.
   This code makes an `Incompatible` error on `2.9.0`, not `2.6.2`.
   I used `sqlalchemy2-stubs==0.0.2a38` and `mypy==1.5.0` in both versions. And 
mypy.ini included `plugins = sqlalchemy.ext.mypy.plugin`
   ```python
   from airflow.models import Base
   from sqlalchemy import Column, Integer
   
   
   class Tester(Base):
       col1 = Column(Integer(), primary_key=True)
   
   
   i: int = Tester.col1
   ```
   
   
   
   ### What you think should happen instead?
   
   _No response_
   
   ### How to reproduce
   
   ### 1. install airflow
   ```bash
   pip install apache-airflow==2.9.0 --constraint 
https://raw.githubusercontent.com/apache/airflow/constraints-2.9.0/constraints-3.10.txt
   ```
   
   ### 2. install mypy and sqlalchemy2-stubs
   ```bash
   pip install mypy==1.5.0 sqlalchemy2-stubs==0.0.2a38
   ```
   
   ### 3. copy mypy.ini
   ```ini
   [mypy]
   plugins = sqlalchemy.ext.mypy.plugin
   
   ```
   
   ### 4. copy code
   ```python
   from airflow.models import Base
   from sqlalchemy import Column, Integer
   
   
   class Tester(Base):
       col1 = Column(Integer(), primary_key=True)
   
   
   i: int = Tester.col1
   ```
   ### 5. run mypy
   ```bash
   mypy mypy --config-file={path of mypy.ini} {path of python file}
   ```
   
   ### Operating System
   
   macOS Ventura: 13.0.1 (22A400)
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Other
   
   ### Deployment details
   
   _No response_
   
   ### 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