@@ -54,21 +54,18 @@ def load_binding_registry() -> None:
54
54
pass
55
55
56
56
57
- def get_deferred_binding (bind_name : str ,
58
- pytype : typing .Optional [type ] = None ) -> object :
57
+ def get_deferred_binding (bind_name : str ) -> object :
59
58
# This will return None if not a supported type
60
59
return DEFERRED_BINDING_REGISTRY .get (bind_name )\
61
- if (DEFERRED_BINDING_REGISTRY is not None
62
- and DEFERRED_BINDING_REGISTRY .check_supported_type (
63
- pytype )) else None
60
+ if (bind_name [- 3 :] == '-db' ) else None
64
61
65
62
66
- def get_binding (bind_name : str , pytype : typing .Optional [type ] = None ) -> object :
67
- # Check if binding is deferred binding
68
- binding = get_deferred_binding (bind_name = bind_name , pytype = pytype )
69
- # Binding is not a deferred binding type
63
+ def get_binding (bind_name : str ) -> object :
64
+ binding = None
70
65
if binding is None :
71
66
binding = BINDING_REGISTRY .get (bind_name )
67
+ if binding is None :
68
+ binding = get_deferred_binding (bind_name = bind_name )
72
69
# Binding is generic
73
70
if binding is None :
74
71
binding = generic .GenericBinding
@@ -81,8 +78,7 @@ def is_trigger_binding(bind_name: str) -> bool:
81
78
82
79
83
80
def check_input_type_annotation (bind_name : str , pytype : type ) -> bool :
84
- # check that needs to pass for sdk bindings -- pass in pytype
85
- binding = get_binding (bind_name , pytype )
81
+ binding = get_binding (bind_name )
86
82
return binding .check_input_type_annotation (pytype )
87
83
88
84
@@ -106,12 +102,12 @@ def has_implicit_output(bind_name: str) -> bool:
106
102
107
103
108
104
def from_incoming_proto (
109
- binding : str ,
105
+ bind_name : str ,
110
106
pb : protos .ParameterBinding , * ,
111
107
pytype : typing .Optional [type ],
112
108
trigger_metadata : typing .Optional [typing .Dict [str , protos .TypedData ]],
113
109
shmem_mgr : SharedMemoryManager ) -> typing .Any :
114
- binding = get_binding (binding , pytype )
110
+ binding = get_binding (bind_name )
115
111
if trigger_metadata :
116
112
metadata = {
117
113
k : datumdef .Datum .from_typed_data (v )
@@ -133,8 +129,7 @@ def from_incoming_proto(
133
129
134
130
try :
135
131
# if the binding is an sdk type binding
136
- if (DEFERRED_BINDING_REGISTRY is not None
137
- and DEFERRED_BINDING_REGISTRY .check_supported_type (pytype )):
132
+ if bind_name [- 3 :] == '-db' :
138
133
return deferred_bindings_decode (binding = binding ,
139
134
pb = pb ,
140
135
pytype = pytype ,
0 commit comments