Skip to content

Commit 3f0eb1c

Browse files
committed
Final code coverage bits
1 parent d5f508f commit 3f0eb1c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

modin/core/storage_formats/base/query_compiler.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ def qc_engine_switch_cost(self, other_qc_type: type) -> int:
307307
Cost of migrating the data from this qc to the other_qc or
308308
None if the cost cannot be determined.
309309
"""
310-
if isinstance(type(self), other_qc_type):
310+
if isinstance(self, other_qc_type):
311311
return QCCoercionCost.COST_ZERO
312312
return None
313313

modin/tests/pandas/native_df_interoperability/test_compiler_caster.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def default_df():
151151

152152
@pytest.fixture()
153153
def default2_df():
154-
return DefaultQC(pandas.DataFrame([0, 1, 2]))
154+
return DefaultQC2(pandas.DataFrame([0, 1, 2]))
155155

156156

157157
def test_two_same_qc_types_noop(pico_df):
@@ -268,3 +268,10 @@ def test_no_qc_to_calculate():
268268
calculator = QueryCompilerCasterCalculator()
269269
with pytest.raises(ValueError):
270270
calculator.calculate()
271+
272+
273+
def test_qc_default_self_cost(default_df, default2_df):
274+
assert default_df.qc_engine_switch_cost(type(default2_df)) is None
275+
assert (
276+
default_df.qc_engine_switch_cost(type(default_df)) is QCCoercionCost.COST_ZERO
277+
)

0 commit comments

Comments
 (0)