From 5fc92dbcfad13d642534c050ea36eb3f0a945a45 Mon Sep 17 00:00:00 2001 From: kmonte Date: Tue, 6 Aug 2024 17:06:27 -0700 Subject: [PATCH] Add maximum_active_task_schedulers method to Env PiperOrigin-RevId: 660154575 --- tfx/orchestration/experimental/core/env.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tfx/orchestration/experimental/core/env.py b/tfx/orchestration/experimental/core/env.py index a1381ecbd7..817ffcc6aa 100644 --- a/tfx/orchestration/experimental/core/env.py +++ b/tfx/orchestration/experimental/core/env.py @@ -158,6 +158,10 @@ def get_status_code_from_exception( Returns None if the exception is not a known type. """ + @abc.abstractmethod + def maximum_concurrent_task_schedulers(self) -> int: + """Returns the maximum number of concurrent task schedulers.""" + class _DefaultEnv(Env): """Default environment.""" @@ -244,6 +248,9 @@ def get_status_code_from_exception( ) -> Optional[int]: return None + def maximum_concurrent_task_schedulers(self) -> int: + return 1 + _ENV = _DefaultEnv()