Skip to content

Commit

Permalink
add select_columns util test
Browse files Browse the repository at this point in the history
Signed-off-by: Labanya Mukhopadhyay <labanya.mukhopadhyay@snowflake.com>
  • Loading branch information
sfc-gh-lmukhopadhyay committed Oct 31, 2024
1 parent 2772842 commit 23fc257
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/integ/modin/frame/test_align.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import pytest

import snowflake.snowpark.modin.plugin # noqa: F401
from snowflake.snowpark.modin.plugin._internal.align_utils import _select_columns
from snowflake.snowpark.modin.plugin._internal.frame import InternalFrame
from tests.integ.modin.utils import (
assert_frame_equal,
assert_snowpark_pandas_equal_to_pandas,
Expand Down Expand Up @@ -323,3 +325,12 @@ def test_align_frame_deprecated_negative():
match="The 'broadcast_axis' keyword in DataFrame.align is deprecated and will be removed in a future version.",
):
left, right = df.align(other_df, join="outer", broadcast_axis=0)


@sql_count_checker(query_count=0)
def test_align_util_select_columns():
snow_df = pd.DataFrame({"A": [0, 1, 0, 1, 2], "B": [1, 2, 3, 4, 5]})
internal_frame: InternalFrame = snow_df._query_compiler._modin_frame
data_column_labels = ["A"]
frame1 = _select_columns(internal_frame, data_column_labels)
assert frame1.data_column_pandas_labels == data_column_labels

0 comments on commit 23fc257

Please sign in to comment.