Skip to content

Commit

Permalink
Temporarily fix date format failed cases for non-UTC time zone. (#10095)
Browse files Browse the repository at this point in the history
Signed-off-by: Chong Gao <[email protected]>
  • Loading branch information
res-life authored Dec 26, 2023
1 parent 1887ccb commit 0a339de
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions integration_tests/src/main/python/date_time_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,8 @@ def test_date_format_for_date(data_gen, date_format):
lambda spark : unary_op_df(spark, data_gen).selectExpr("date_format(a, '{}')".format(date_format)))

@pytest.mark.parametrize('date_format', supported_date_formats, ids=idfn)
@pytest.mark.parametrize('data_gen', [timestamp_gen], ids=idfn)
# use 9999-12-30 instead of 9999-12-31 to avoid the issue: https://github.com/NVIDIA/spark-rapids/issues/10083
@pytest.mark.parametrize('data_gen', [TimestampGen(end=datetime(9999, 12, 30, 23, 59, 59, 999999, tzinfo=timezone.utc))], ids=idfn)
@pytest.mark.skipif(not is_supported_time_zone(), reason="not all time zones are supported now, refer to https://github.com/NVIDIA/spark-rapids/issues/6839, please update after all time zones are supported")
def test_date_format_for_time(data_gen, date_format):
assert_gpu_and_cpu_are_equal_collect(
Expand Down Expand Up @@ -519,7 +520,11 @@ def test_date_format_maybe(data_gen, date_format):
'DateFormatClass')

@pytest.mark.parametrize('date_format', maybe_supported_date_formats, ids=idfn)
@pytest.mark.parametrize('data_gen', date_n_time_gens, ids=idfn)

@pytest.mark.parametrize('data_gen', [date_gen,
# use 9999-12-30 instead of 9999-12-31 to avoid the issue: https://github.com/NVIDIA/spark-rapids/issues/10083
TimestampGen(end=datetime(9999, 12, 30, 23, 59, 59, 999999, tzinfo=timezone.utc))
], ids=idfn)
@allow_non_gpu(*non_utc_allow)
def test_date_format_maybe_incompat(data_gen, date_format):
conf = {"spark.rapids.sql.incompatibleDateFormats.enabled": "true"}
Expand Down

0 comments on commit 0a339de

Please sign in to comment.