amoghrajesh commented on code in PR #53387:
URL: https://github.com/apache/airflow/pull/53387#discussion_r2282243902
##########
airflow-core/src/airflow/jobs/job.py:
##########
@@ -41,7 +42,19 @@
from airflow.utils.platform import getuser
from airflow.utils.session import NEW_SESSION, create_session, provide_session
from airflow.utils.sqlalchemy import UtcDateTime
-from airflow.utils.state import JobState
+
+
+class JobState(str, Enum):
+ """All possible states that a Job can be in."""
+
+ RUNNING = "running"
+ SUCCESS = "success"
+ RESTARTING = "restarting"
+ FAILED = "failed"
+
+ def __str__(self) -> str:
+ return self.value
Review Comment:
You can have this path and reuse though as part of this PR.
##########
task-sdk/src/airflow/sdk/api/datamodels/_generated.py:
##########
@@ -472,6 +472,13 @@ class TaskInstanceState(str, Enum):
DEFERRED = "deferred"
+class JobState(str, Enum):
+ RUNNING = "running"
+ SUCCESS = "success"
+ RESTARTING = "restarting"
+ FAILED = "failed"
Review Comment:
`JobState` is only EVER relevant to scheduler / CLI for the jobs command. It
is definitely not needed in the task SDK as it has nothing to do with DAG
author experience.
--
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]