Skip to content

Commit 99ac0a2

Browse files
committed
chore: add tests for today
1 parent b073f8a commit 99ac0a2

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

python/tests/test_functions.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,6 +1087,20 @@ def test_temporal_formatter_requires_expr():
10871087
f.to_time(literal("12:30:45"), "not-an-expr")
10881088

10891089

1090+
def test_today_returns_date32(df):
1091+
result = df.select(f.today().alias("today")).collect()[0]
1092+
assert result.column(0).type == pa.date32()
1093+
1094+
1095+
def test_today_alias_matches_current_date(df):
1096+
result = df.select(
1097+
f.current_date().alias("current_date"),
1098+
f.today().alias("today"),
1099+
).collect()[0]
1100+
1101+
assert result.column(0) == result.column(1)
1102+
1103+
10901104
def test_arrow_cast(df):
10911105
df = df.select(
10921106
# we use `string_literal` to return utf8 instead of `literal` which returns

0 commit comments

Comments
 (0)