mik-laj commented on a change in pull request #6749: [AIRFLOW-6193] Do not use
asserts in Airflow main code
URL: https://github.com/apache/airflow/pull/6749#discussion_r355145977
##########
File path: airflow/executors/dask_executor.py
##########
@@ -87,19 +90,23 @@ def _process_future(self, future: Future) -> None:
self.futures.pop(future)
def sync(self) -> None:
- assert self.futures, NOT_STARTED_MESSAGE
+ if not self.futures:
+ raise AirflowException(NOT_STARTED_MESSAGE)
# make a copy so futures can be popped during iteration
for future in self.futures.copy():
self._process_future(future)
def end(self) -> None:
- assert self.client, NOT_STARTED_MESSAGE
- assert self.futures, NOT_STARTED_MESSAGE
+ if not self.client:
Review comment:
```suggestion
if not self.client or not self.futures:
```
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services