Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions tests/integ/modin/frame/test_eval_and_query/test_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
):
Expand Down
28 changes: 19 additions & 9 deletions tests/integ/modin/hybrid/test_switch_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand Down