Skip to content

Commit 97d40ee

Browse files
authored
[Cherrypick] Fix PostCommit Python job (#35709)
[Cherrypick] Fix PostCommit Python job (#35709)
2 parents bd6a10a + 34bb3ad commit 97d40ee

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

sdks/python/apache_beam/examples/inference/gemini_text_classification.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,11 @@ def parse_known_args(argv):
6767

6868
class PostProcessor(beam.DoFn):
6969
def process(self, element: PredictionResult) -> Iterable[str]:
70-
yield "Input: " + str(element.example) + " Output: " + str(
71-
element.inference[1][0].content.parts[0].text)
70+
try:
71+
output_text = element.inference[1][0].content.parts[0].text
72+
yield f"Input: {element.example}, Output: {output_text}"
73+
except Exception:
74+
yield f"Can't decode inference for element: {element.example}"
7275

7376

7477
def run(

sdks/python/apache_beam/io/debezium.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def __init__(
155155
username=username,
156156
password=password,
157157
host=host,
158-
port=port,
158+
port=str(port),
159159
max_number_of_records=max_number_of_records,
160160
connection_properties=connection_properties)
161161
self.expansion_service = expansion_service or default_io_expansion_service()

0 commit comments

Comments
 (0)