diff --git a/src/snowflake/snowpark/modin/plugin/extensions/series_overrides.py b/src/snowflake/snowpark/modin/plugin/extensions/series_overrides.py index 19ee80a9d2..cdeb72fd8f 100644 --- a/src/snowflake/snowpark/modin/plugin/extensions/series_overrides.py +++ b/src/snowflake/snowpark/modin/plugin/extensions/series_overrides.py @@ -405,6 +405,26 @@ def to_excel( ) +@register_series_not_implemented() +def to_json( + self, + path_or_buf=None, + orient=None, + date_format=None, + double_precision=10, + force_ascii=True, + date_unit="ms", + default_handler=None, + lines=False, + compression="infer", + index=None, + indent=None, + storage_options: StorageOptions = None, + mode="w", +) -> str | None: # noqa: PR01, RT01, D200 + pass # pragma: no cover + + @register_series_not_implemented() def to_period(self, freq=None, copy=True): # noqa: PR01, RT01, D200 pass # pragma: no cover diff --git a/tests/integ/modin/frame/test_eval_and_query/test_eval.py b/tests/integ/modin/frame/test_eval_and_query/test_eval.py index ffefacfe1b..4e53eaa50f 100644 --- a/tests/integ/modin/frame/test_eval_and_query/test_eval.py +++ b/tests/integ/modin/frame/test_eval_and_query/test_eval.py @@ -292,11 +292,7 @@ class TestInplace: param({"inplace": False}, id="inplace_False"), ], ) - @pytest.mark.xfail( - strict=True, - raises=AssertionError, - reason="https://github.com/modin-project/modin/issues/7669", - ) + @sql_count_checker(query_count=2) def test_inplace_false_with_assignment_does_not_mutate_df( self, test_dfs, engine_kwargs, inplace_kwargs ): diff --git a/tests/integ/modin/hybrid/test_switch_operations.py b/tests/integ/modin/hybrid/test_switch_operations.py index cec233a65c..bb00c2ce17 100644 --- a/tests/integ/modin/hybrid/test_switch_operations.py +++ b/tests/integ/modin/hybrid/test_switch_operations.py @@ -32,6 +32,9 @@ from snowflake.snowpark.modin.plugin._internal.frame import InternalFrame from snowflake.snowpark.modin.plugin.utils.warning_message import WarningMessage from snowflake.snowpark.modin.plugin.extensions.datetime_index import DatetimeIndex +from snowflake.snowpark.modin.plugin._internal.utils import ( + MODIN_IS_AT_LEAST_0_37_0, +) from tests.integ.utils.sql_counter import sql_count_checker from tests.integ.modin.utils import assert_snowpark_pandas_equal_to_pandas @@ -151,21 +154,23 @@ def test_move_to_me_cost_with_incompatible_dtype(caplog): df_incompatible.move_to("Snowflake") -# There is no query count because the Snowflake->Pandas migration -# of the small dataset is not counted and there is no actual materialization -# of the merge -@sql_count_checker(query_count=0) +# Newer version of modin switches before the merge +@sql_count_checker(query_count=2 if MODIN_IS_AT_LEAST_0_37_0 else 0) def test_merge(init_transaction_tables, us_holidays_data): df_transactions = pd.read_snowflake("REVENUE_TRANSACTIONS") df_us_holidays = pd.DataFrame(us_holidays_data, columns=["Holiday", "Date"]) assert df_transactions.get_backend() == "Snowflake" assert df_us_holidays.get_backend() == "Pandas" - # Since `df_us_holidays` is much smaller than `df_transactions`, we moved `df_us_holidays` - # to Snowflake where `df_transactions` is, to perform the operation. combined = pd.merge( df_us_holidays, df_transactions, left_on="Date", right_on="DATE" ) - assert combined.get_backend() == "Snowflake" + if MODIN_IS_AT_LEAST_0_37_0: + # Because the result of the merge is small enough to be faster to execute in native pandas, + # we move the Snowflake data to pandas. + assert combined.get_backend() == "Pandas" + else: + # Older version of modin moves to Snowflake because df_us_holidays is small. + assert combined.get_backend() == "Snowflake" @sql_count_checker(query_count=2) @@ -337,7 +342,8 @@ def test_explain_switch_empty(): assert new_switch_index_names == empty_switch_index_names -@sql_count_checker(query_count=0) +# Newer version of modin switches before the merge +@sql_count_checker(query_count=2 if MODIN_IS_AT_LEAST_0_37_0 else 0) def test_explain_switch(init_transaction_tables, us_holidays_data): clear_hybrid_switch_log() df_transactions = pd.read_snowflake("REVENUE_TRANSACTIONS") @@ -427,7 +433,11 @@ def test_unimplemented_autoswitches(class_name, method_name, f_args, use_session # Series.to_json will output an extraneous level for the __reduced__ column, but that's OK # since we don't officially support the method. # See modin bug: https://github.com/modin-project/modin/issues/7624 - if class_name == "Series" and method_name == "to_json": + if ( + not MODIN_IS_AT_LEAST_0_37_0 + and class_name == "Series" + and method_name == "to_json" + ): assert snow_result == '{"__reduced__":{"0":1,"1":2,"2":3}}' else: assert snow_result == pandas_result