Skip to content

Commit

Permalink
SNOW-1628820 remove timedelta warning message (#2178)
Browse files Browse the repository at this point in the history
SNOW-1628820 remove timedelta warning message and update notebooks
  • Loading branch information
sfc-gh-azhan authored Aug 28, 2024
1 parent f11f6ee commit bbc8781
Show file tree
Hide file tree
Showing 7 changed files with 1,382 additions and 367 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,8 @@
import pandas as native_pd

from snowflake.snowpark.column import Column
from snowflake.snowpark.modin.plugin.utils.warning_message import WarningMessage
from snowflake.snowpark.types import DataType, LongType

TIMEDELTA_WARNING_MESSAGE = (
"Snowpark pandas support for Timedelta is not currently available."
)

"""Map Python type to its from_pandas method"""
_python_type_to_from_pandas: dict[type, Callable[[Any], Any]] = {}

Expand Down Expand Up @@ -128,9 +123,6 @@ class TimedeltaType(SnowparkPandasType, LongType):
)

def __init__(self) -> None:
# TODO(SNOW-1620452): Remove this warning message before releasing
# Timedelta support.
WarningMessage.single_warning(TIMEDELTA_WARNING_MESSAGE)
super().__init__()

@staticmethod
Expand Down
10 changes: 2 additions & 8 deletions tests/integ/modin/types/test_timedelta.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved.
#
import datetime
import logging

import modin.pandas as pd
import pandas as native_pd
import pytest

from snowflake.snowpark.modin.plugin._internal.snowpark_pandas_types import (
TIMEDELTA_WARNING_MESSAGE,
)
from tests.integ.modin.sql_counter import sql_count_checker
from tests.integ.modin.utils import (
assert_series_equal,
Expand All @@ -21,13 +17,11 @@


@sql_count_checker(query_count=1)
def test_create_timedelta_column_from_pandas_timedelta(caplog):
def test_create_timedelta_column_from_pandas_timedelta():
pandas_df = native_pd.DataFrame(
{"timedelta_column": [native_pd.Timedelta(nanoseconds=1)], "int_column": [3]}
)
with caplog.at_level(logging.DEBUG):
snow_df = pd.DataFrame(pandas_df)
assert TIMEDELTA_WARNING_MESSAGE in caplog.text
snow_df = pd.DataFrame(pandas_df)
eval_snowpark_pandas_result(snow_df, pandas_df, lambda df: df)


Expand Down
206 changes: 190 additions & 16 deletions tests/notebooks/modin/MIMICHealthcareDemo.ipynb

Large diffs are not rendered by default.

658 changes: 512 additions & 146 deletions tests/notebooks/modin/SnowflakeChainTesting.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit bbc8781

Please sign in to comment.