Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-vbudati committed Jun 10, 2024
1 parent bd1f755 commit 9b01d8d
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 76 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,5 @@ docs/source/modin/pandas_api/
# performance test result
tests/perf/results/
tests/perf/*.dat

tests/parameters.py
7 changes: 0 additions & 7 deletions src/snowflake/snowpark/modin/plugin/_internal/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -1921,12 +1921,6 @@ def append(self) -> None:
Returns
-------
Index
Examples
--------
>>> idx = pd.Index([1, 2, 3])
>>> idx.append(pd.Index([4]))
Index([1, 2, 3, 4], dtype='int64')
"""
# TODO: SNOW-1458149 implement append

Expand Down Expand Up @@ -2219,7 +2213,6 @@ def get_indexer(self) -> None:
example below.
"""

@index_not_implemented()
def get_indexer_for(self, target: Any) -> Any:
"""
Guaranteed return of an indexer even when non-unique.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def dropna():
Keep only the rows with at least 2 non-NA values.
>>> df.dropna(thresh=2)
>>> df.dropna(thresh=2) # doctest: +SKIP
name toy born
1 Batman Batmobile 1940-04-25
2 Catwoman Bullwhip NaT
Expand Down
136 changes: 68 additions & 68 deletions tests/integ/modin/test_unimplemented.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,75 +170,75 @@ def test_unsupported_dt_methods(func, func_name, caplog) -> None:

# unsupported methods for Index
UNSUPPORTED_INDEX_METHODS = [
(lambda idx: idx.is_monotonic_increasing, "property fget:is_monotonic_increasing"),
(lambda idx: idx.is_monotonic_decreasing, "property fget:is_monotonic_decreasing"),
(lambda idx: idx.inferred_type, "property fget:inferred_type"),
(lambda idx: idx.shape, "property fget:shape"),
(lambda idx: idx.nbytes, "property fget:nbytes"),
(lambda idx: idx.ndim, "property fget:ndim"),
(lambda idx: idx.size, "property fget:size"),
(lambda idx: idx.empty, "property fget:empty"),
(lambda idx: idx.T, "property fget:T"),
(lambda idx: idx.memory_usage, "property fget:memory_usage"),
(lambda idx: idx.all, "all"),
(lambda idx: idx.any, "any"),
(lambda idx: idx.all, "all"),
(lambda idx: idx.argmin, "argmin"),
(lambda idx: idx.argmax, "argmax"),
(lambda idx: idx.delete, "delete"),
(lambda idx: idx.all, "all"),
(lambda idx: idx.drop_duplicates, "drop_duplicates"),
(lambda idx: idx.factorize, "factorize"),
(lambda idx: idx.identical, "identical"),
(lambda idx: idx.insert, "insert"),
(lambda idx: idx.is_, "is_"),
(lambda idx: idx.is_boolean, "is_boolean"),
(lambda idx: idx.is_categorical, "is_categorical"),
(lambda idx: idx.is_floating, "is_floating"),
(lambda idx: idx.is_integer, "is_integer"),
(lambda idx: idx.is_interval, "is_interval"),
(lambda idx: idx.is_numeric, "is_numeric"),
(lambda idx: idx.is_object, "is_object"),
(lambda idx: idx.min, "min"),
(lambda idx: idx.max, "max"),
(lambda idx: idx.reindex, "reindex"),
(lambda idx: idx.rename, "rename"),
(lambda idx: idx.repeat, "repeat"),
(lambda idx: idx.where, "where"),
(lambda idx: idx.take, "take"),
(lambda idx: idx.putmask, "putmask"),
(lambda idx: idx.unique, "unique"),
(lambda idx: idx.nunique, "nunique"),
(lambda idx: idx.droplevel, "droplevel"),
(lambda idx: idx.fillna, "fillna"),
(lambda idx: idx.dropna, "dropna"),
(lambda idx: idx.isna, "isna"),
(lambda idx: idx.notna, "notna"),
(lambda idx: idx.item, "item"),
(lambda idx: idx.map, "map"),
(lambda idx: idx.ravel, "ravel"),
(lambda idx: idx.to_series, "to_series"),
(lambda idx: idx.to_frame, "to_frame"),
(lambda idx: idx.argsort, "argsort"),
(lambda idx: idx.searchsorted, "searchsorted"),
(lambda idx: idx.shift, "shift"),
(lambda idx: idx.append, "append"),
(lambda idx: idx.join, "join"),
(lambda idx: idx.symmetric_difference, "symmetric_difference"),
(lambda idx: idx.asof, "asof"),
(lambda idx: idx.asof_locs, "asof_locs"),
(lambda idx: idx.get_indexer, "get_indexer"),
(lambda idx: idx.get_indexer_for, "get_indexer_for"),
(lambda idx: idx.get_indexer_non_unique, "get_indexer_non_unique"),
(lambda idx: idx.get_loc, "get_loc"),
(lambda idx: idx.get_slice_bound, "get_slice_bound"),
(lambda idx: idx.isin, "isin"),
(lambda idx: idx.slice_locs, "slice_locs"),
lambda idx: idx.is_monotonic_increasing(),
lambda idx: idx.is_monotonic_decreasing(),
lambda idx: idx.inferred_type(),
lambda idx: idx.shape(),
lambda idx: idx.nbytes(),
lambda idx: idx.ndim(),
lambda idx: idx.size(),
lambda idx: idx.empty(),
lambda idx: idx.T(),
lambda idx: idx.memory_usage(),
lambda idx: idx.all(),
lambda idx: idx.any(),
lambda idx: idx.all(),
lambda idx: idx.argmin(),
lambda idx: idx.argmax(),
lambda idx: idx.delete(),
lambda idx: idx.all(),
lambda idx: idx.drop_duplicates(),
lambda idx: idx.factorize(),
lambda idx: idx.identical(),
lambda idx: idx.insert(),
lambda idx: idx.is_(),
lambda idx: idx.is_boolean(),
lambda idx: idx.is_categorical(),
lambda idx: idx.is_floating(),
lambda idx: idx.is_integer(),
lambda idx: idx.is_interval(),
lambda idx: idx.is_numeric(),
lambda idx: idx.is_object(),
lambda idx: idx.min(),
lambda idx: idx.max(),
lambda idx: idx.reindex(),
lambda idx: idx.rename(),
lambda idx: idx.repeat(),
lambda idx: idx.where(),
lambda idx: idx.take(),
lambda idx: idx.putmask(),
lambda idx: idx.unique(),
lambda idx: idx.nunique(),
lambda idx: idx.droplevel(),
lambda idx: idx.fillna(),
lambda idx: idx.dropna(),
lambda idx: idx.isna(),
lambda idx: idx.notna(),
lambda idx: idx.item(),
lambda idx: idx.map(),
lambda idx: idx.ravel(),
lambda idx: idx.to_series(),
lambda idx: idx.to_frame(),
lambda idx: idx.argsort(),
lambda idx: idx.searchsorted(),
lambda idx: idx.shift(),
lambda idx: idx.append(),
lambda idx: idx.join(),
lambda idx: idx.symmetric_difference(),
lambda idx: idx.asof(),
lambda idx: idx.asof_locs(),
lambda idx: idx.get_indexer(),
lambda idx: idx.get_indexer_non_unique(),
lambda idx: idx.get_loc(),
lambda idx: idx.get_slice_bound(),
lambda idx: idx.isin(),
lambda idx: idx.slice_locs(),
]


@pytest.mark.parametrize("func, func_name", UNSUPPORTED_INDEX_METHODS)
@pytest.mark.parametrize("func", UNSUPPORTED_INDEX_METHODS)
@sql_count_checker(query_count=0)
def test_unsupported_index_methods(func, func_name, caplog) -> None:
native_index = native_pd.Index([5, 4, 0, 6, 6, 4])
eval_and_validate_unsupported_methods(func, func_name, [native_index], caplog)
def test_unsupported_index_methods(func) -> None:
index = pd.Index([5, 4, 0, 6, 6, 4])
with pytest.raises(NotImplementedError):
func(index)

0 comments on commit 9b01d8d

Please sign in to comment.