airbyte_cdk.sources.declarative.async_job.status

 1# Copyright (c) 2024 Airbyte, Inc., all rights reserved.
 2
 3
 4from enum import Enum
 5
 6_TERMINAL = True
 7
 8
 9class AsyncJobStatus(Enum):
10    RUNNING = ("RUNNING", not _TERMINAL)
11    COMPLETED = ("COMPLETED", _TERMINAL)
12    FAILED = ("FAILED", _TERMINAL)
13    TIMED_OUT = ("TIMED_OUT", _TERMINAL)
14
15    def __init__(self, value: str, is_terminal: bool) -> None:
16        self._value = value
17        self._is_terminal = is_terminal
18
19    def is_terminal(self) -> bool:
20        """
21        A status is terminal when a job status can't be updated anymore. For example if a job is completed, it will stay completed but a
22        running job might because completed, failed or timed out.
23        """
24        return self._is_terminal
class AsyncJobStatus(enum.Enum):
10class AsyncJobStatus(Enum):
11    RUNNING = ("RUNNING", not _TERMINAL)
12    COMPLETED = ("COMPLETED", _TERMINAL)
13    FAILED = ("FAILED", _TERMINAL)
14    TIMED_OUT = ("TIMED_OUT", _TERMINAL)
15
16    def __init__(self, value: str, is_terminal: bool) -> None:
17        self._value = value
18        self._is_terminal = is_terminal
19
20    def is_terminal(self) -> bool:
21        """
22        A status is terminal when a job status can't be updated anymore. For example if a job is completed, it will stay completed but a
23        running job might because completed, failed or timed out.
24        """
25        return self._is_terminal

An enumeration.

RUNNING = <AsyncJobStatus.RUNNING: ('RUNNING', False)>
COMPLETED = <AsyncJobStatus.COMPLETED: ('COMPLETED', True)>
FAILED = <AsyncJobStatus.FAILED: ('FAILED', True)>
TIMED_OUT = <AsyncJobStatus.TIMED_OUT: ('TIMED_OUT', True)>
def is_terminal(self) -> bool:
20    def is_terminal(self) -> bool:
21        """
22        A status is terminal when a job status can't be updated anymore. For example if a job is completed, it will stay completed but a
23        running job might because completed, failed or timed out.
24        """
25        return self._is_terminal

A status is terminal when a job status can't be updated anymore. For example if a job is completed, it will stay completed but a running job might because completed, failed or timed out.