Skip to content

Commit

Permalink
Centralize exec stage urn string (#29947)
Browse files Browse the repository at this point in the history
* Move exec stage urn string

* Minor ordering update.

---------

Co-authored-by: Robert Bradshaw <robertwb@gmail.com>
  • Loading branch information
hjtran and robertwb authored Jan 19, 2024
1 parent 774082f commit d5a7fc9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions sdks/python/apache_beam/portability/common_urns.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
combine_components = StandardPTransforms.CombineComponents
sdf_components = StandardPTransforms.SplittableParDoComponents
group_into_batches_components = StandardPTransforms.GroupIntoBatchesComponents
executable_stage = "beam:runner:executable_stage:v1"

user_state = StandardUserStateTypes.Enum
side_inputs = StandardSideInputTypes.Enum
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ def executable_stage_transform(
return beam_runner_api_pb2.PTransform(
unique_name=unique_name(None, self.name),
spec=beam_runner_api_pb2.FunctionSpec(
urn='beam:runner:executable_stage:v1',
urn=common_urns.executable_stage,
payload=exec_payload.SerializeToString()),
inputs=named_inputs,
outputs={
Expand Down
2 changes: 1 addition & 1 deletion sdks/python/apache_beam/runners/trivial_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def execute_transform(self, transform_id, execution_state):
for pc in transform_proto.inputs.values()
], []))

elif transform_proto.spec.urn == 'beam:runner:executable_stage:v1':
elif transform_proto.spec.urn == common_urns.executable_stage:
# This is a collection of user DoFns.
self.execute_executable_stage(transform_proto, execution_state)

Expand Down

0 comments on commit d5a7fc9

Please sign in to comment.