jscheffl commented on code in PR #45008:
URL: https://github.com/apache/airflow/pull/45008#discussion_r1890256526
##########
providers/src/airflow/providers/edge/cli/edge_command.py:
##########
@@ -137,11 +132,26 @@ class _Job:
"""Holds all information for a task/job to be executed as bundle."""
edge_job: EdgeJobFetched
- process: Popen
+ process: Popen | Process
logfile: Path
logsize: int
"""Last size of log file, point of last chunk push."""
+ @property
+ def is_running(self) -> bool:
+ """Check if the job is still running."""
+ if isinstance(self.process, Popen):
+ self.process.poll()
+ return self.process.returncode is None
+ return self.process.exitcode is None
+
+ @property
+ def is_success(self) -> bool:
+ """Check if the job was successful."""
+ if isinstance(self.process, Popen):
+ return self.process.returncode == 0
Review Comment:
Thanks AI, in general context this makes sense. In the context used here it
is only called once the process is completed. Therefore will leave it as is.
--
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]