File tree 3 files changed +10
-6
lines changed 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -129,6 +129,13 @@ def resolve_placeholder_expression(
129
129
return result
130
130
131
131
132
+ def empty_placeholder_context () -> ResolutionContext :
133
+ """Returns an empty placeholder context."""
134
+ return ResolutionContext (
135
+ exec_info = data_types .ExecutionInfo (),
136
+ )
137
+
138
+
132
139
class _Operation (enum .Enum ):
133
140
"""Alias for Operation enum types in placeholder.proto."""
134
141
Original file line number Diff line number Diff line change @@ -1689,8 +1689,8 @@ def testMakeProtoOpResolvesProto(self):
1689
1689
placeholder_pb2 .PlaceholderExpression (),
1690
1690
)
1691
1691
resolved_proto = placeholder_utils .resolve_placeholder_expression (
1692
- placeholder_expression , placeholder_utils .ResolutionContext (
1693
- exec_info = data_types . ExecutionInfo ()) )
1692
+ placeholder_expression , placeholder_utils .empty_placeholder_context ()
1693
+ )
1694
1694
self .assertProtoEquals (
1695
1695
"""
1696
1696
splits: "train"
Original file line number Diff line number Diff line change 17
17
18
18
from tfx .dsl .compiler import placeholder_utils
19
19
from tfx .dsl .placeholder import placeholder_base
20
- from tfx .orchestration .portable import data_types
21
20
22
21
23
22
def resolve (
@@ -39,9 +38,7 @@ def resolve(
39
38
return placeholder_utils .resolve_placeholder_expression (
40
39
placeholder .encode (),
41
40
resolution_context
42
- or placeholder_utils .ResolutionContext (
43
- exec_info = data_types .ExecutionInfo ()
44
- ),
41
+ or placeholder_utils .empty_placeholder_context (),
45
42
)
46
43
47
44
You can’t perform that action at this time.
0 commit comments