Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Prevent generation of 'year 0 is out of range' strings in IT #9918

Merged
merged 4 commits into from
Dec 1, 2023

Conversation

thirtiseven
Copy link
Collaborator

fixes #9916

This PR fixes some DataGen(StringGen) which generated out of range data in IT.

The regex:

'(0{0,3}1-(0?[2-9]|[1-3][0-9]))|(([0-9]{0,3}[2-9]|[1-9][0-9]{0,2}[01])-[0-3]?[0-9])-[0-5]?[0-9]'

can generated data start from 01-02-01, and keeps the invalid date as negative cases.

A simple breakdown:
(0{0,3}1-(0?[2-9]|[1-3][0-9])): 'valid' months in year 1, e. g. 001-2, 1-30
(([1-9][0-9]{0,2}[01])-[0-3]?[0-9]): years end with but not only 0, 1, all months.
(([0-9]{0,3}[2-9])-[0-3]?[0-9]): years end with 2-9, all months.

Tested with large data locally without failed, and the coverage looks as excepted.

…e error in IT

Signed-off-by: Haoyang Li <haoyangl@nvidia.com>
Signed-off-by: Haoyang Li <haoyangl@nvidia.com>
Signed-off-by: Haoyang Li <haoyangl@nvidia.com>
@thirtiseven thirtiseven self-assigned this Dec 1, 2023
Signed-off-by: Haoyang Li <haoyangl@nvidia.com>
@thirtiseven
Copy link
Collaborator Author

build

@pxLi pxLi merged commit 06a398b into NVIDIA:branch-24.02 Dec 1, 2023
@sameerz sameerz added the test Only impacts tests label Dec 2, 2023
@thirtiseven thirtiseven deleted the year0strgen branch December 19, 2023 08:44
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
test Only impacts tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] test_cast_string_ts_valid_format failed at seed = 1701362564
4 participants