Skip to content

Commit

Permalink
Update test case related to LEACY datetime format to unblock nightly …
Browse files Browse the repository at this point in the history
…CI (#11544)

Signed-off-by: Chong Gao <[email protected]>
Co-authored-by: Chong Gao <[email protected]>
  • Loading branch information
res-life and Chong Gao authored Oct 8, 2024
1 parent 5eeddc6 commit cd46572
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions docs/compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -662,9 +662,10 @@ LEGACY timeParserPolicy support has the following limitations when running on th
- The proleptic Gregorian calendar is used instead of the hybrid Julian+Gregorian calendar
that Spark uses in legacy mode
- When format is `yyyyMMdd`, GPU only supports 8 digit strings. Spark supports like 7 digit
`2024101` string while GPU does not support.
`2024101` string while GPU does not support. Only tested `UTC` and `Asia/Shanghai` timezones.
- When format is `yyyymmdd`, GPU only supports 8 digit strings. Spark supports like 7 digit
`2024101` string while GPU does not support.
`2024101` string while GPU does not support. Only tested `UTC` and `Asia/Shanghai` timezones.


## Formatting dates and timestamps as strings

Expand Down
6 changes: 3 additions & 3 deletions integration_tests/src/main/python/date_time_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,9 +463,9 @@ def test_to_timestamp(parser_policy):
@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")
@pytest.mark.parametrize("format", ['yyyyMMdd', 'yyyymmdd'], ids=idfn)
# Test years after 1900, refer to issues: https://github.com/NVIDIA/spark-rapids/issues/11543, https://github.com/NVIDIA/spark-rapids/issues/11539
@pytest.mark.parametrize("data_gen_regexp", ['(19[0-9]{2})([0-5][0-9])([0-3][0-9])', '(19[0-9]{2})([0-9]{4})'], ids=idfn)
def test_formats_for_legacy_mode(format, data_gen_regexp):
gen = StringGen(data_gen_regexp)
@pytest.mark.skipif(get_test_tz() != "Asia/Shanghai" and get_test_tz() != "UTC", reason="https://github.com/NVIDIA/spark-rapids/issues/11562")
def test_formats_for_legacy_mode(format):
gen = StringGen('(19[0-9]{2}|[2-9][0-9]{3})([0-9]{4})')
assert_gpu_and_cpu_are_equal_sql(
lambda spark : unary_op_df(spark, gen),
"tab",
Expand Down

0 comments on commit cd46572

Please sign in to comment.