Skip to content

Commit c827ae5

Browse files
SNOW-2679281: Add missing tests and changelog entries for dt.dayofweek/weekday/dayofyear/isocalendar (already supported in faster pandas) (#3992)
1 parent cb667c3 commit c827ae5

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@
124124
- `dt.month_name`
125125
- `dt.day_name`
126126
- `dt.strftime`
127+
- `dt.dayofweek`
128+
- `dt.weekday`
129+
- `dt.dayofyear`
130+
- `dt.isocalendar`
127131
- `rolling.min`
128132
- `rolling.max`
129133
- `rolling.count`

tests/integ/modin/test_faster_pandas.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,6 +1328,9 @@ def test_str_translate(session):
13281328
"is_leap_year",
13291329
"days_in_month",
13301330
"daysinmonth",
1331+
"dayofweek",
1332+
"weekday",
1333+
"dayofyear",
13311334
],
13321335
)
13331336
@sql_count_checker(query_count=3)
@@ -1375,7 +1378,7 @@ def test_dt_properties(session, property_name):
13751378
assert_series_equal(snow_result, native_result)
13761379

13771380

1378-
@pytest.mark.parametrize("func", ["normalize", "month_name", "day_name"])
1381+
@pytest.mark.parametrize("func", ["normalize", "month_name", "day_name", "isocalendar"])
13791382
@sql_count_checker(query_count=3)
13801383
def test_dt_functions_no_params(session, func):
13811384
with session_parameter_override(
@@ -1417,7 +1420,10 @@ def test_dt_functions_no_params(session, func):
14171420
native_result = getattr(native_df["A"].dt, func)()
14181421

14191422
# compare results
1420-
assert_series_equal(snow_result, native_result)
1423+
if func == "isocalendar":
1424+
assert_frame_equal(snow_result, native_result, check_dtype=False)
1425+
else:
1426+
assert_series_equal(snow_result, native_result)
14211427

14221428

14231429
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)