@@ -64,7 +64,9 @@ def calculate(self):
64
64
costs_2 = qc_2 .qc_engine_switch_cost (qc_1 )
65
65
self ._add_cost_data (costs_1 )
66
66
self ._add_cost_data (costs_2 )
67
-
67
+ if len (self ._caster_costing_map ) <= 0 and len (self ._qc_cls_list ) > 0 :
68
+ self ._result_type = self ._qc_cls_list [0 ]
69
+ return self ._result_type
68
70
min_value = min (self ._caster_costing_map .values ())
69
71
for key , value in self ._caster_costing_map .items ():
70
72
if min_value == value :
@@ -163,16 +165,16 @@ def apply_argument_cast(obj: Fn) -> Fn:
163
165
"""
164
166
if isinstance (obj , type ):
165
167
all_attrs = dict (inspect .getmembers (obj ))
166
- all_attrs .pop ("__abstractmethods__" )
167
- all_attrs .pop ("__init__" )
168
- all_attrs .pop ("qc_engine_switch_cost" )
169
- all_attrs .pop ("from_pandas" )
168
+
170
169
171
170
# This is required because inspect converts class methods to member functions
172
171
current_class_attrs = vars (obj )
173
172
for key in current_class_attrs :
174
173
all_attrs [key ] = current_class_attrs [key ]
175
-
174
+ all_attrs .pop ("__abstractmethods__" )
175
+ all_attrs .pop ("__init__" )
176
+ all_attrs .pop ("qc_engine_switch_cost" )
177
+ all_attrs .pop ("from_pandas" )
176
178
for attr_name , attr_value in all_attrs .items ():
177
179
if isinstance (
178
180
attr_value , (FunctionType , MethodType , classmethod , staticmethod )
@@ -203,7 +205,6 @@ def cast_args(*args: Tuple, **kwargs: Dict) -> Any:
203
205
"""
204
206
if len (args ) == 0 and len (kwargs ) == 0 :
205
207
return
206
- print (f"Adding wrapper { obj } \n " )
207
208
current_qc = args [0 ]
208
209
calculator = QueryCompilerCasterCalculator ()
209
210
calculator .add_query_compiler (current_qc )
0 commit comments