@@ -1441,13 +1441,18 @@ def WithKeys(pcoll, k, *args, **kwargs):
14411441 if all (isinstance (arg , AsSideInput )
14421442 for arg in args ) and all (isinstance (kwarg , AsSideInput )
14431443 for kwarg in kwargs .values ()):
1444- return pcoll | Map (
1444+ # Map(lambda) produces a label formatted like this, but it cannot be
1445+ # changed without breaking update compat. Here, we pin to the transform
1446+ # name used in the 2.68 release to avoid breaking changes when the line
1447+ # number changes. Context: https://github.com/apache/beam/pull/36381
1448+ return pcoll | "Map(<lambda at util.py:1189>)" >> Map (
14451449 lambda v , * args , ** kwargs : (k (v , * args , ** kwargs ), v ),
14461450 * args ,
14471451 ** kwargs )
1448- return pcoll | Map (lambda v : (k (v , * args , ** kwargs ), v ))
1449- return pcoll | Map (lambda v : (k (v ), v ))
1450- return pcoll | Map (lambda v : (k , v ))
1452+ return pcoll | "Map(<lambda at util.py:1192>)" >> Map (
1453+ lambda v : (k (v , * args , ** kwargs ), v ))
1454+ return pcoll | "Map(<lambda at util.py:1193>)" >> Map (lambda v : (k (v ), v ))
1455+ return pcoll | "Map(<lambda at util.py:1194>)" >> Map (lambda v : (k , v ))
14511456
14521457
14531458@typehints .with_input_types (tuple [K , V ])
@@ -1527,7 +1532,11 @@ def __init__(
15271532
15281533 def expand (self , pcoll ):
15291534 key_type , value_type = pcoll .element_type .tuple_types
1530- sharded_pcoll = pcoll | Map (
1535+ # Map(lambda) produces a label formatted like this, but it cannot be
1536+ # changed without breaking update compat. Here, we pin to the transform
1537+ # name used in the 2.68 release to avoid breaking changes when the line
1538+ # number changes. Context: https://github.com/apache/beam/pull/36381
1539+ sharded_pcoll = pcoll | "Map(<lambda at util.py:1275>)" >> Map (
15311540 lambda key_value : (
15321541 ShardedKey (
15331542 key_value [0 ],
@@ -2032,7 +2041,12 @@ def replace_all(pcoll, regex, replacement):
20322041 replacement: the string to be substituted for each match.
20332042 """
20342043 regex = Regex ._regex_compile (regex )
2035- return pcoll | Map (lambda elem : regex .sub (replacement , elem ))
2044+ # Map(lambda) produces a label formatted like this, but it cannot be
2045+ # changed without breaking update compat. Here, we pin to the transform
2046+ # name used in the 2.68 release to avoid breaking changes when the line
2047+ # number changes. Context: https://github.com/apache/beam/pull/36381
2048+ return pcoll | "Map(<lambda at util.py:1779>)" >> Map (
2049+ lambda elem : regex .sub (replacement , elem ))
20362050
20372051 @staticmethod
20382052 @typehints .with_input_types (str )
@@ -2048,7 +2062,12 @@ def replace_first(pcoll, regex, replacement):
20482062 replacement: the string to be substituted for each match.
20492063 """
20502064 regex = Regex ._regex_compile (regex )
2051- return pcoll | Map (lambda elem : regex .sub (replacement , elem , 1 ))
2065+ # Map(lambda) produces a label formatted like this, but it cannot be
2066+ # changed without breaking update compat. Here, we pin to the transform
2067+ # name used in the 2.68 release to avoid breaking changes when the line
2068+ # number changes. Context: https://github.com/apache/beam/pull/36381
2069+ return pcoll | "Map(<lambda at util.py:1795>)" >> Map (
2070+ lambda elem : regex .sub (replacement , elem , 1 ))
20522071
20532072 @staticmethod
20542073 @typehints .with_input_types (str )
@@ -2139,4 +2158,9 @@ def expand(self, pcoll):
21392158 | f"WaitOn{ ix } " >> (beam .FlatMap (lambda x : ()) | GroupByKey ()))
21402159 for (ix , side ) in enumerate (self ._to_be_waited_on )
21412160 ]
2142- return pcoll | beam .Map (lambda x , * unused_sides : x , * sides )
2161+ # Map(lambda) produces a label formatted like this, but it cannot be
2162+ # changed without breaking update compat. Here, we pin to the transform
2163+ # name used in the 2.68 release to avoid breaking changes when the line
2164+ # number changes. Context: https://github.com/apache/beam/pull/36381
2165+ return pcoll | "Map(<lambda at util.py:1886>)" >> beam .Map (
2166+ lambda x , * unused_sides : x , * sides )
0 commit comments