Skip to content

Commit 918d94c

Browse files
committed
Fix the data_cls when we are moving to a new qc for the current operation
1 parent afb69d7 commit 918d94c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

modin/core/storage_formats/pandas/query_compiler_caster.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ def cast_to_qc(arg):
272272
qc_type = calculator.calculate()
273273
if qc_type is None or qc_type is type(arg):
274274
return arg
275+
# TODO: Should use the factory dispatcher here to switch backends
275276
return qc_type.from_pandas(
276277
arg.to_pandas(), data_cls=calculator.result_data_cls()
277278
)
@@ -294,8 +295,10 @@ def cast_to_qc(arg):
294295
# args since it references self on the original argument
295296
# call
296297
if result_qc_type != current_qc:
297-
data_cls = current_qc._modin_frame
298-
new_qc = result_qc_type.from_pandas(current_qc.to_pandas(), data_cls)
298+
# TODO: Should use the factory dispatcher here to switch backends
299+
new_qc = result_qc_type.from_pandas(
300+
current_qc.to_pandas(), data_cls=calculator.result_data_cls()
301+
)
299302
obj_new = getattr(new_qc, obj.__name__)
300303
return obj_new(*args[1:], **kwargs)
301304

0 commit comments

Comments
 (0)