Skip to content

Commit

Permalink
Add maximum_active_task_schedulers method to Env
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 660179475
  • Loading branch information
kmonte authored and tfx-copybara committed Aug 7, 2024
1 parent 5e90c67 commit c695752
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tfx/orchestration/experimental/core/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ def get_status_code_from_exception(
Returns None if the exception is not a known type.
"""

@abc.abstractmethod
def maximum_active_task_schedulers(self) -> int:
"""Returns the maximum number of active task schedulers."""


class _DefaultEnv(Env):
"""Default environment."""
Expand Down Expand Up @@ -244,6 +248,9 @@ def get_status_code_from_exception(
) -> Optional[int]:
return None

def maximum_active_task_schedulers(self) -> int:
return 1


_ENV = _DefaultEnv()

Expand Down
3 changes: 3 additions & 0 deletions tfx/orchestration/experimental/core/env_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ def record_orchestration_time(self, pipeline_run_id: str) -> None:
def should_orchestrate(self, pipeline: pipeline_pb2.Pipeline) -> bool:
raise NotImplementedError()

def maximum_active_task_schedulers(self) -> int:
raise NotImplementedError()


class EnvTest(test_utils.TfxTest):

Expand Down

0 comments on commit c695752

Please sign in to comment.