Skip to content

Commit

Permalink
test needs marks for non-UTC and for non_supported timezones (#10171)
Browse files Browse the repository at this point in the history
Signed-off-by: Navin Kumar <[email protected]>
  • Loading branch information
NVnavkumar authored Jan 9, 2024
1 parent 47047a9 commit 4e57f5f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion integration_tests/src/main/python/cast_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import pytest

from asserts import *
from conftest import is_not_utc
from conftest import is_not_utc, is_supported_time_zone
from data_gen import *
from spark_session import *
from marks import allow_non_gpu, approximate_float, datagen_overrides, tz_sensitive_test
Expand Down Expand Up @@ -540,6 +540,8 @@ def test_cast_timestamp_to_string():
lambda spark: unary_op_df(spark, timestamp_gen)
.selectExpr("cast(a as string)"))

@tz_sensitive_test
@allow_non_gpu(*non_supported_tz_allow)
def test_cast_timestamp_to_date():
assert_gpu_and_cpu_are_equal_collect(
lambda spark: unary_op_df(spark, timestamp_gen)
Expand Down
7 changes: 6 additions & 1 deletion integration_tests/src/main/python/data_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from spark_session import is_before_spark_340, with_cpu_session
import sre_yield
import struct
from conftest import skip_unless_precommit_tests, get_datagen_seed, is_not_utc
from conftest import skip_unless_precommit_tests, get_datagen_seed, is_not_utc, is_supported_time_zone
import time
import os
from functools import lru_cache
Expand Down Expand Up @@ -1212,6 +1212,11 @@ def get_25_partitions_df(spark):
'DeserializeToObjectExec', 'DataWritingCommandExec', 'WriteFilesExec', 'ShuffleExchangeExec',
'ExecutedCommandExec'] if is_not_utc() else []

non_supported_tz_allow = ['ProjectExec', 'FilterExec', 'FileSourceScanExec', 'BatchScanExec', 'CollectLimitExec',
'DeserializeToObjectExec', 'DataWritingCommandExec', 'WriteFilesExec', 'ShuffleExchangeExec',
'ExecutedCommandExec'] if not is_supported_time_zone() else []


# date related regexps for generating date strings within python's range limits

# regexp to generate date from 0001-02-01, format is yyyy-MM-dd
Expand Down

0 comments on commit 4e57f5f

Please sign in to comment.