subkanthi commented on issue #19891:
URL: https://github.com/apache/airflow/issues/19891#issuecomment-995362082
Is there a way to fix this? Thanks
```
airflow/providers/cncf/kubernetes/utils/pod_launcher.py:328: error:
Incompatible return value type (got "TaskInstanceState", expected "State")
return State.QUEUED
^
airflow/providers/cncf/kubernetes/utils/pod_launcher.py:331: error:
Incompatible return value type (got "TaskInstanceState", expected "State")
return State.FAILED
^
airflow/providers/cncf/kubernetes/utils/pod_launcher.py:334: error:
Incompatible return value type (got "TaskInstanceState", expected "State")
return State.SUCCESS
^
airflow/providers/cncf/kubernetes/utils/pod_launcher.py:336: error:
Incompatible return value type (got "TaskInstanceState", expected "State")
return State.RUNNING
^
airflow/providers/cncf/kubernetes/utils/pod_launcher.py:339: error:
Incompatible return value type (got "TaskInstanceState", expected "State")
return State.FAILED
```
` def process_status(self, job_id: str, status: str) -> State:
"""Process status information for the JOB"""
status = status.lower()
if status == PodStatus.PENDING:
return State.QUEUED
elif status == PodStatus.FAILED:
self.log.error('Event with job id %s Failed', job_id)
return State.FAILED
elif status == PodStatus.SUCCEEDED:
self.log.info('Event with job id %s Succeeded', job_id)
return State.SUCCESS
elif status == PodStatus.RUNNING:
return State.RUNNING
else:
self.log.error('Event: Invalid state %s on job %s', status,
job_id)
return State.FAILED`
```
# These are TaskState only
NONE = None
REMOVED = TaskInstanceState.REMOVED
SCHEDULED = TaskInstanceState.SCHEDULED
QUEUED = TaskInstanceState.QUEUED
SHUTDOWN = TaskInstanceState.SHUTDOWN
RESTARTING = TaskInstanceState.RESTARTING
UP_FOR_RETRY = TaskInstanceState.UP_FOR_RETRY
UP_FOR_RESCHEDULE = TaskInstanceState.UP_FOR_RESCHEDULE
UPSTREAM_FAILED = TaskInstanceState.UPSTREAM_FAILED
SKIPPED = TaskInstanceState.SKIPPED
SENSING = TaskInstanceState.SENSING
DEFERRED = TaskInstanceState.DEFERRED
```
--
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]