This is an automated email from the ASF dual-hosted git repository.
damccorm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/master by this push:
new 5dad7a6659c Fix PostCommit Python job (#35709)
5dad7a6659c is described below
commit 5dad7a6659cbedf3bd9ff905467413a692090a02
Author: Vitaly Terentyev <[email protected]>
AuthorDate: Wed Jul 30 20:40:07 2025 +0400
Fix PostCommit Python job (#35709)
* Fix debezium port type, fix gemini post processor fn
* Add condition
* Use try/catch
---
.../apache_beam/examples/inference/gemini_text_classification.py | 7 +++++--
sdks/python/apache_beam/io/debezium.py | 2 +-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git
a/sdks/python/apache_beam/examples/inference/gemini_text_classification.py
b/sdks/python/apache_beam/examples/inference/gemini_text_classification.py
index e82f407374a..b264467467c 100644
--- a/sdks/python/apache_beam/examples/inference/gemini_text_classification.py
+++ b/sdks/python/apache_beam/examples/inference/gemini_text_classification.py
@@ -67,8 +67,11 @@ def parse_known_args(argv):
class PostProcessor(beam.DoFn):
def process(self, element: PredictionResult) -> Iterable[str]:
- yield "Input: " + str(element.example) + " Output: " + str(
- element.inference[1][0].content.parts[0].text)
+ try:
+ output_text = element.inference[1][0].content.parts[0].text
+ yield f"Input: {element.example}, Output: {output_text}"
+ except Exception:
+ yield f"Can't decode inference for element: {element.example}"
def run(
diff --git a/sdks/python/apache_beam/io/debezium.py
b/sdks/python/apache_beam/io/debezium.py
index 9e93801852c..26516fa4e4b 100644
--- a/sdks/python/apache_beam/io/debezium.py
+++ b/sdks/python/apache_beam/io/debezium.py
@@ -155,7 +155,7 @@ class ReadFromDebezium(PTransform):
username=username,
password=password,
host=host,
- port=port,
+ port=str(port),
max_number_of_records=max_number_of_records,
connection_properties=connection_properties)
self.expansion_service = expansion_service or
default_io_expansion_service()