@@ -1138,14 +1138,14 @@ def test_binary_op_preserve_dtypes():
1138
1138
def setup_cache (df , has_cache = True ):
1139
1139
if has_cache :
1140
1140
_ = df .dtypes
1141
- assert df ._query_compiler ._modin_frame . has_materialized_dtypes
1141
+ assert df ._query_compiler .frame_has_materialized_dtypes
1142
1142
else :
1143
- df ._query_compiler ._modin_frame . set_dtypes_cache (None )
1144
- assert not df ._query_compiler ._modin_frame . has_materialized_dtypes
1143
+ df ._query_compiler .set_frame_dtypes_cache (None )
1144
+ assert not df ._query_compiler .frame_has_materialized_dtypes
1145
1145
return df
1146
1146
1147
1147
def assert_cache (df , has_cache = True ):
1148
- assert not (has_cache ^ df ._query_compiler ._modin_frame . has_materialized_dtypes )
1148
+ assert not (has_cache ^ df ._query_compiler .frame_has_materialized_dtypes )
1149
1149
1150
1150
# Check when `other` is a non-distributed object
1151
1151
assert_cache (setup_cache (df ) + 2.0 )
@@ -1179,7 +1179,7 @@ def remove_cache(df, axis):
1179
1179
if axis :
1180
1180
df ._query_compiler ._modin_frame .set_columns_cache (None )
1181
1181
else :
1182
- df ._query_compiler ._modin_frame . set_index_cache (None )
1182
+ df ._query_compiler .set_frame_index_cache (None )
1183
1183
assert_no_cache (df , axis )
1184
1184
return df
1185
1185
@@ -1195,30 +1195,30 @@ def test_setitem_bool_preserve_dtypes():
1195
1195
df = pd .DataFrame ({"a" : [1 , 1 , 2 , 2 ], "b" : [3 , 4 , 5 , 6 ]})
1196
1196
indexer = pd .Series ([True , False , True , False ])
1197
1197
1198
- assert df ._query_compiler ._modin_frame . has_materialized_dtypes
1198
+ assert df ._query_compiler .frame_has_materialized_dtypes
1199
1199
1200
1200
# slice(None) as a col_loc
1201
1201
df .loc [indexer ] = 2.0
1202
- assert df ._query_compiler ._modin_frame . has_materialized_dtypes
1202
+ assert df ._query_compiler .frame_has_materialized_dtypes
1203
1203
1204
1204
# list as a col_loc
1205
1205
df .loc [indexer , ["a" , "b" ]] = 2.0
1206
- assert df ._query_compiler ._modin_frame . has_materialized_dtypes
1206
+ assert df ._query_compiler .frame_has_materialized_dtypes
1207
1207
1208
1208
# scalar as a col_loc
1209
1209
df .loc [indexer , "a" ] = 2.0
1210
- assert df ._query_compiler ._modin_frame . has_materialized_dtypes
1210
+ assert df ._query_compiler .frame_has_materialized_dtypes
1211
1211
1212
1212
1213
1213
def test_setitem_unhashable_preserve_dtypes ():
1214
1214
df = pd .DataFrame ([[1 , 2 , 3 , 4 ], [5 , 6 , 7 , 8 ]])
1215
- assert df ._query_compiler ._modin_frame . has_materialized_dtypes
1215
+ assert df ._query_compiler .frame_has_materialized_dtypes
1216
1216
1217
1217
df2 = pd .DataFrame ([[9 , 9 ], [5 , 5 ]])
1218
- assert df2 ._query_compiler ._modin_frame . has_materialized_dtypes
1218
+ assert df2 ._query_compiler .frame_has_materialized_dtypes
1219
1219
1220
1220
df [[1 , 2 ]] = df2
1221
- assert df ._query_compiler ._modin_frame . has_materialized_dtypes
1221
+ assert df ._query_compiler .frame_has_materialized_dtypes
1222
1222
1223
1223
1224
1224
@pytest .mark .parametrize ("modify_config" , [{RangePartitioning : True }], indirect = True )
@@ -1246,7 +1246,7 @@ def test_reindex_preserve_dtypes(kwargs):
1246
1246
df = pd .DataFrame ({"a" : [1 , 1 , 2 , 2 ], "b" : [3 , 4 , 5 , 6 ]})
1247
1247
1248
1248
reindexed_df = df .reindex (** kwargs )
1249
- assert reindexed_df ._query_compiler ._modin_frame . has_materialized_dtypes
1249
+ assert reindexed_df ._query_compiler .frame_has_materialized_dtypes
1250
1250
1251
1251
1252
1252
class TestModinIndexIds :
@@ -2039,7 +2039,7 @@ def test_concat_axis_1(
2039
2039
)
2040
2040
# setting columns cache to 'None', in order to prevent completing 'dtypes' with the materialized columns
2041
2041
md_df ._query_compiler ._modin_frame .set_columns_cache (None )
2042
- md_df ._query_compiler ._modin_frame . set_dtypes_cache (
2042
+ md_df ._query_compiler .set_frame_dtypes_cache (
2043
2043
ModinDtypes (
2044
2044
DtypesDescriptor (
2045
2045
known_dtypes ,
@@ -2100,7 +2100,7 @@ def test_update_parent(self):
2100
2100
2101
2101
# 'df2' will have a 'DtypesDescriptor' with unknown dtypes for a column 'c'
2102
2102
df2 = pd .DataFrame ({"c" : [2 , 3 , 4 ]})
2103
- df2 ._query_compiler ._modin_frame . set_dtypes_cache (None )
2103
+ df2 ._query_compiler .set_frame_dtypes_cache (None )
2104
2104
dtypes_cache = df2 ._query_compiler ._modin_frame ._dtypes
2105
2105
assert isinstance (
2106
2106
dtypes_cache ._value , DtypesDescriptor
@@ -2226,7 +2226,7 @@ def test_set_index_with_dupl_labels(self):
2226
2226
"""Verify that setting duplicated columns doesn't propagate any errors to a user."""
2227
2227
df = pd .DataFrame ({"a" : [1 , 2 , 3 , 4 ], "b" : [3.5 , 4.4 , 5.5 , 6.6 ]})
2228
2228
# making sure that dtypes are represented by an unmaterialized dtypes-descriptor
2229
- df ._query_compiler ._modin_frame . set_dtypes_cache (None )
2229
+ df ._query_compiler .set_frame_dtypes_cache (None )
2230
2230
2231
2231
df .columns = ["a" , "a" ]
2232
2232
assert df .dtypes .equals (
@@ -2252,8 +2252,8 @@ def test_concat_mi(self):
2252
2252
)
2253
2253
2254
2254
# Drop actual dtypes in order to use partially-known dtypes
2255
- md_df1 ._query_compiler ._modin_frame . set_dtypes_cache (None )
2256
- md_df2 ._query_compiler ._modin_frame . set_dtypes_cache (None )
2255
+ md_df1 ._query_compiler .set_frame_dtypes_cache (None )
2256
+ md_df2 ._query_compiler .set_frame_dtypes_cache (None )
2257
2257
2258
2258
md_res = pd .concat ([md_df1 , md_df2 ], axis = 1 )
2259
2259
pd_res = pandas .concat ([pd_df1 , pd_df2 ], axis = 1 )
@@ -2282,9 +2282,9 @@ def test_preserve_dtypes_setitem(self, self_dtype, value, value_dtype):
2282
2282
with mock .patch .object (PandasDataframe , "_compute_dtypes" ) as patch :
2283
2283
df = pd .DataFrame ({"a" : [1 , 2 ], "b" : [3 , 4 ], "c" : [3 , 4 ]})
2284
2284
if self_dtype == "materialized" :
2285
- assert df ._query_compiler ._modin_frame . has_materialized_dtypes
2285
+ assert df ._query_compiler .frame_has_materialized_dtypes
2286
2286
elif self_dtype == "partial" :
2287
- df ._query_compiler ._modin_frame . set_dtypes_cache (
2287
+ df ._query_compiler .set_frame_dtypes_cache (
2288
2288
ModinDtypes (
2289
2289
DtypesDescriptor (
2290
2290
{"a" : np .dtype ("int64" )},
@@ -2293,7 +2293,7 @@ def test_preserve_dtypes_setitem(self, self_dtype, value, value_dtype):
2293
2293
)
2294
2294
)
2295
2295
elif self_dtype == "unknown" :
2296
- df ._query_compiler ._modin_frame . set_dtypes_cache (None )
2296
+ df ._query_compiler .set_frame_dtypes_cache (None )
2297
2297
else :
2298
2298
raise NotImplementedError (self_dtype )
2299
2299
@@ -2304,7 +2304,7 @@ def test_preserve_dtypes_setitem(self, self_dtype, value, value_dtype):
2304
2304
[np .dtype ("int64" ), value_dtype , np .dtype ("int64" )],
2305
2305
index = ["a" , "b" , "c" ],
2306
2306
)
2307
- assert df ._query_compiler ._modin_frame . has_materialized_dtypes
2307
+ assert df ._query_compiler .frame_has_materialized_dtypes
2308
2308
assert df .dtypes .equals (result_dtype )
2309
2309
elif self_dtype == "partial" :
2310
2310
result_dtype = DtypesDescriptor (
@@ -2339,17 +2339,17 @@ def test_preserve_dtypes_insert(self, self_dtype, value, value_dtype):
2339
2339
with mock .patch .object (PandasDataframe , "_compute_dtypes" ) as patch :
2340
2340
df = pd .DataFrame ({"a" : [1 , 2 ], "b" : [3 , 4 ]})
2341
2341
if self_dtype == "materialized" :
2342
- assert df ._query_compiler ._modin_frame . has_materialized_dtypes
2342
+ assert df ._query_compiler .frame_has_materialized_dtypes
2343
2343
elif self_dtype == "partial" :
2344
- df ._query_compiler ._modin_frame . set_dtypes_cache (
2344
+ df ._query_compiler .set_frame_dtypes_cache (
2345
2345
ModinDtypes (
2346
2346
DtypesDescriptor (
2347
2347
{"a" : np .dtype ("int64" )}, cols_with_unknown_dtypes = ["b" ]
2348
2348
)
2349
2349
)
2350
2350
)
2351
2351
elif self_dtype == "unknown" :
2352
- df ._query_compiler ._modin_frame . set_dtypes_cache (None )
2352
+ df ._query_compiler .set_frame_dtypes_cache (None )
2353
2353
else :
2354
2354
raise NotImplementedError (self_dtype )
2355
2355
@@ -2360,7 +2360,7 @@ def test_preserve_dtypes_insert(self, self_dtype, value, value_dtype):
2360
2360
[value_dtype , np .dtype ("int64" ), np .dtype ("int64" )],
2361
2361
index = ["c" , "a" , "b" ],
2362
2362
)
2363
- assert df ._query_compiler ._modin_frame . has_materialized_dtypes
2363
+ assert df ._query_compiler .frame_has_materialized_dtypes
2364
2364
assert df .dtypes .equals (result_dtype )
2365
2365
elif self_dtype == "partial" :
2366
2366
result_dtype = DtypesDescriptor (
@@ -2390,7 +2390,7 @@ def test_get_dummies_case(self):
2390
2390
cols = [col for col in res .columns if col != "items" ]
2391
2391
res [cols ] = res [cols ] / res [cols ].mean ()
2392
2392
2393
- assert res ._query_compiler ._modin_frame . has_materialized_dtypes
2393
+ assert res ._query_compiler .frame_has_materialized_dtypes
2394
2394
2395
2395
patch .assert_not_called ()
2396
2396
@@ -2403,21 +2403,21 @@ def test_preserve_dtypes_reset_index(self, drop, has_materialized_index):
2403
2403
if has_materialized_index :
2404
2404
assert df ._query_compiler ._modin_frame .has_materialized_index
2405
2405
else :
2406
- df ._query_compiler ._modin_frame . set_index_cache (None )
2406
+ df ._query_compiler .set_frame_index_cache (None )
2407
2407
assert not df ._query_compiler ._modin_frame .has_materialized_index
2408
- assert df ._query_compiler ._modin_frame . has_materialized_dtypes
2408
+ assert df ._query_compiler .frame_has_materialized_dtypes
2409
2409
2410
2410
res = df .reset_index (drop = drop )
2411
2411
if drop :
2412
2412
# we droped the index, so columns and dtypes shouldn't change
2413
- assert res ._query_compiler ._modin_frame . has_materialized_dtypes
2413
+ assert res ._query_compiler .frame_has_materialized_dtypes
2414
2414
assert res .dtypes .equals (df .dtypes )
2415
2415
else :
2416
2416
if has_materialized_index :
2417
2417
# we should have inserted index dtype into the descriptor,
2418
2418
# and since both of them are materialized, the result should be
2419
2419
# materialized too
2420
- assert res ._query_compiler ._modin_frame . has_materialized_dtypes
2420
+ assert res ._query_compiler .frame_has_materialized_dtypes
2421
2421
assert res .dtypes .equals (
2422
2422
pandas .Series (
2423
2423
[np .dtype ("int64" ), np .dtype ("int64" )], index = ["index" , "a" ]
@@ -2436,7 +2436,7 @@ def test_preserve_dtypes_reset_index(self, drop, has_materialized_index):
2436
2436
2437
2437
# case 2: 'df' has partial dtype by default
2438
2438
df = pd .DataFrame ({"a" : [1 , 2 , 3 ], "b" : [3 , 4 , 5 ]})
2439
- df ._query_compiler ._modin_frame . set_dtypes_cache (
2439
+ df ._query_compiler .set_frame_dtypes_cache (
2440
2440
ModinDtypes (
2441
2441
DtypesDescriptor (
2442
2442
{"a" : np .dtype ("int64" )}, cols_with_unknown_dtypes = ["b" ]
@@ -2446,7 +2446,7 @@ def test_preserve_dtypes_reset_index(self, drop, has_materialized_index):
2446
2446
if has_materialized_index :
2447
2447
assert df ._query_compiler ._modin_frame .has_materialized_index
2448
2448
else :
2449
- df ._query_compiler ._modin_frame . set_index_cache (None )
2449
+ df ._query_compiler .set_frame_index_cache (None )
2450
2450
assert not df ._query_compiler ._modin_frame .has_materialized_index
2451
2451
2452
2452
res = df .reset_index (drop = drop )
0 commit comments