kaxil commented on a change in pull request #6702: [AIRFLOW-6140] Add missing 
types for some core classes. Depends on [AIRFLOW-6004]
URL: https://github.com/apache/airflow/pull/6702#discussion_r352922159
 
 

 ##########
 File path: airflow/models/baseoperator.py
 ##########
 @@ -869,11 +877,16 @@ def get_task_instances(self, start_date=None, 
end_date=None, session=None):
             .order_by(TaskInstance.execution_date)\
             .all()
 
-    def get_flat_relative_ids(self, upstream=False, found_descendants=None):
+    def get_flat_relative_ids(self,
+                              upstream: bool = False,
+                              found_descendants: Optional[Set[str]] = None) -> 
Set[str]:
         """
-        Get a flat list of relatives' ids, either upstream or downstream.
+        Get a flat set of relatives' ids, either upstream or downstream.
         """
 
+        if not self._dag:
+            return set()
 
 Review comment:
   When is this helpful?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to