You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by da...@apache.org on 2026/04/01 14:47:25 UTC

(beam) 01/01: Fix lint

This is an automated email from the ASF dual-hosted git repository.

damccorm pushed a commit to branch users/damccorm/fix-lint
in repository https://gitbox.apache.org/repos/asf/beam.git

commit 609528f2a0057335a278d353542879858f8be123
Author: Danny Mccormick <da...@google.com>
AuthorDate: Wed Apr 1 10:47:11 2026 -0400

    Fix lint
---
 sdks/python/apache_beam/ml/inference/agent_development_kit.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sdks/python/apache_beam/ml/inference/agent_development_kit.py b/sdks/python/apache_beam/ml/inference/agent_development_kit.py
index 392a4667398..196fc62c193 100644
--- a/sdks/python/apache_beam/ml/inference/agent_development_kit.py
+++ b/sdks/python/apache_beam/ml/inference/agent_development_kit.py
@@ -57,6 +57,7 @@ from collections.abc import Iterable
 from collections.abc import Sequence
 from typing import Any
 from typing import Optional
+from typing import Union
 
 from apache_beam.ml.inference.base import ModelHandler
 from apache_beam.ml.inference.base import PredictionResult
@@ -74,15 +75,14 @@ except ImportError:
   ADK_AVAILABLE = False
   genai_Content = Any  # type: ignore[assignment, misc]
   genai_Part = Any  # type: ignore[assignment, misc]
-  Agent = None
 
 LOGGER = logging.getLogger("ADKAgentModelHandler")
 
 # Type alias for an agent or factory that produces one
-_AgentOrFactory = Agent | Callable[[], Agent]
+_AgentOrFactory = Union["Agent", Callable[[], "Agent"]]
 
 
-class ADKAgentModelHandler(ModelHandler[str | genai_Content,
+class ADKAgentModelHandler(ModelHandler[Union[str, genai_Content],
                                         PredictionResult,
                                         "Runner"]):
   """ModelHandler for running ADK agents with the Beam RunInference transform.
@@ -185,7 +185,7 @@ class ADKAgentModelHandler(ModelHandler[str | genai_Content,
 
   def run_inference(
       self,
-      batch: Sequence[str | genai_Content],
+      batch: Sequence[Union[str, genai_Content]],
       model: "Runner",
       inference_args: Optional[dict[str, Any]] = None,
   ) -> Iterable[PredictionResult]: