Skip to content

Commit

Permalink
resolve comments and fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-azhan committed Aug 28, 2024
1 parent dc619af commit 40994a3
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def join(
), f"Invalid join type: {how}. Allowed values are {get_args(JoinTypeLit)}"

def assert_snowpark_pandas_types_match() -> None:
"""If Snowpark pandas types does not match, then a ValueError will be raised."""
"""If Snowpark pandas types do not match, then a ValueError will be raised."""
left_types = [
left.snowflake_quoted_identifier_to_snowpark_pandas_type.get(id, None)
for id in left_on
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1499,7 +1499,7 @@ def _shift_values_axis_0(
row_position_quoted_identifier = frame.row_position_snowflake_quoted_identifier

fill_value_dtype = infer_object_type(fill_value)
fill_value = pandas_lit(fill_value) if fill_value is not None else None
fill_value = None if pd.isna(fill_value) else pandas_lit(fill_value)

def shift_expression_and_type(
quoted_identifier: str, dtype: DataType
Expand Down
2 changes: 1 addition & 1 deletion tests/integ/modin/frame/test_isin.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def test_isin_dataframe_values_type_negative():
)
def test_isin_timedelta(values):
native_df = native_pd.DataFrame({"a": [1, 2, 3], "b": [None, 4, 2]}).astype(
"timedelta64[ns]"
{"b": "timedelta64[ns]"}
)
snow_df = pd.DataFrame(native_df)

Expand Down
2 changes: 1 addition & 1 deletion tests/integ/modin/frame/test_iterrows.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def assert_iterators_equal(snowpark_iterator, native_iterator):
),
# empty df
native_pd.DataFrame([]),
native_pd.DataFrame({"ts": native_pd.timedelta_range(10, periods=10)}),
native_pd.DataFrame({"ts": native_pd.timedelta_range(10, periods=4)}),
],
)
def test_df_iterrows(native_df):
Expand Down
6 changes: 1 addition & 5 deletions tests/integ/modin/series/test_shift.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ def test_series_with_values_shift(series, periods, fill_value):
lambda s: s.shift(
periods=periods,
fill_value=pd.Timedelta(fill_value)
if isinstance(
s, native_pd.Series
) # pandas does not support fill int to timedelta
and s.dtype == "timedelta64[ns]"
and fill_value is not no_default
if s.dtype == "timedelta64[ns]" and fill_value is not no_default
else fill_value,
),
)
Expand Down

0 comments on commit 40994a3

Please sign in to comment.