Skip to content

Commit 4118956

Browse files
committed
Remove else
1 parent 1a2096b commit 4118956

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

  • sdks/python/apache_beam/typehints

sdks/python/apache_beam/typehints/batch.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,9 @@ def from_typehints(*, element_type, batch_type) -> 'BatchConverter':
9393
errors = {}
9494
for name, constructor in BATCH_CONVERTER_REGISTRY.items():
9595
try:
96-
result = constructor(element_type, batch_type)
96+
return constructor(element_type, batch_type)
9797
except TypeError as e:
9898
errors[name] = e.args[0]
99-
else:
100-
return result
10199

102100
error_summaries = '\n\n'.join(
103101
f"{name}:\n\t{msg}" for name, msg in errors.items())

0 commit comments

Comments
 (0)