Skip to content

Commit

Permalink
Fix to_utc_timestamp and from_utc_timestamp fallback when TZ is suppo…
Browse files Browse the repository at this point in the history
…rted time zone (#10223)

Signed-off-by: Chong Gao <res_life@163.com>
  • Loading branch information
res-life authored Jan 19, 2024
1 parent a168f6e commit 787a74c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
2 changes: 0 additions & 2 deletions integration_tests/src/main/python/date_time_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,6 @@ def test_unsupported_fallback_to_unix_timestamp(data_gen):
unsupported_timezones = ["PST", "NST", "AST", "America/Los_Angeles", "America/New_York", "America/Chicago"]

@pytest.mark.parametrize('time_zone', supported_timezones, ids=idfn)
@allow_non_gpu(*non_utc_allow)
def test_from_utc_timestamp(time_zone):
assert_gpu_and_cpu_are_equal_collect(
lambda spark: unary_op_df(spark, timestamp_gen).select(f.from_utc_timestamp(f.col('a'), time_zone)))
Expand All @@ -311,7 +310,6 @@ def test_unsupported_fallback_from_utc_timestamp():
"from_utc_timestamp(a, tzone)"),
'FromUTCTimestamp')

@allow_non_gpu(*non_utc_allow)
@pytest.mark.parametrize('time_zone', supported_timezones, ids=idfn)
def test_to_utc_timestamp(time_zone):
assert_gpu_and_cpu_are_equal_collect(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1154,7 +1154,6 @@ abstract class BaseExprMeta[INPUT <: Expression](
//| Value | needTimeZoneCheck | isTimeZoneSupported |
//+------------------------+-------------------+-----------------------------------------+
//| TimezoneAwareExpression| True | False by default, True when implemented |
//| UTCTimestamp | True | False by default, True when implemented |
//| Others | False | N/A (will not be checked) |
//+------------------------+-------------------+-----------------------------------------+
lazy val needTimeZoneCheck: Boolean = {
Expand All @@ -1171,7 +1170,6 @@ abstract class BaseExprMeta[INPUT <: Expression](
} else{
true
}
case _: UTCTimestamp => true
case _ => false
}
}
Expand Down

0 comments on commit 787a74c

Please sign in to comment.