uranusjr commented on a change in pull request #20011:
URL: https://github.com/apache/airflow/pull/20011#discussion_r761915807



##########
File path: airflow/models/xcom.py
##########
@@ -376,4 +505,7 @@ def resolve_xcom_backend():
     return BaseXCom
 
 
-XCom = resolve_xcom_backend()
+if TYPE_CHECKING:
+    XCom = BaseXCom  # Hack to avoid Mypy "Variable 'XCom' is not valid as a 
type".
+else:
+    XCom = resolve_xcom_backend()

Review comment:
       I think this is fine, the cause is actually the overloads:
   
   ```
   WARNING: duplicate object description of airflow.models.xcom.BaseXCom.clear, 
other instance in _api/airflow/models/xcom/index, use :noindex: for one of them
   
   File path: apache-airflow/_api/airflow/models/xcom/index.rst (215)
   
    210 |    .. classmethod:: clear(cls, execution_date: pendulum.DateTime, 
dag_id: str, task_id: str, session: Optional[Session] = None)
    211 | 
    212 | 
    213 | 
    214 |    
   >215 |    .. classmethod:: clear(cls, execution_date: Optional = None, 
dag_id: Optional = None, task_id: Optional = None, *, run_id: Optional = None, 
session: Session)
    216 | 
    217 |       Clears all XCom data from the database for the task instance
    218 | 
    219 |       ``run_id`` and ``execution_date`` are mutually exclusive.
   ```
   
   I think generated by sphinx-autoapi. I’d expect it to support this _years_ 
old feature; it’s very disappoiting.




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