gopidesupavan commented on code in PR #53004:
URL: https://github.com/apache/airflow/pull/53004#discussion_r2193475088


##########
airflow-core/src/airflow/models/baseoperator.py:
##########
@@ -296,7 +296,7 @@ def __init__(self, **kwargs):
         def dag(self) -> SchedulerDAG:  # type: ignore[override]
             return super().dag  # type: ignore[return-value]
 
-        @dag.setter
+        @dag.setter  # type: ignore[override]

Review Comment:
   The SchedulerDAG is of imported here from the models `from 
airflow.models.dag import DAG as SchedulerDAG` and the BaseOperator base class 
TaskSDKBaseOperator using TaskSDK Dag,  i think thats the difference type issue 
here.
   
   cc: @ashb  can add any pointers?
   
   ```
   airflow-core/src/airflow/models/baseoperator.py:299: error: Incompatible 
override of a setter type  [override]
               @dag.setter
                ^
   airflow-core/src/airflow/models/baseoperator.py:299: note:  (base class 
"BaseOperator" defined the type as "airflow.sdk.definitions.dag.DAG | None",
   airflow-core/src/airflow/models/baseoperator.py:299: note:  override has 
type "airflow.models.dag.DAG")
   airflow-core/src/airflow/models/baseoperator.py:299: note:  Setter types 
should behave contravariantly
   
   ```



-- 
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