-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: AddDataValidation() and DeleteDataValidation() are concurrency safe, and add some unit test and code optimization. #1828
Feat: AddDataValidation() and DeleteDataValidation() are concurrency safe, and add some unit test and code optimization. #1828
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your pull request. I've left some comments.
…coordinatesToRangeRef,squashSqref,flatSqref function.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1828 +/- ##
=======================================
Coverage 99.21% 99.21%
=======================================
Files 32 32
Lines 23926 23930 +4
=======================================
+ Hits 23737 23741 +4
Misses 101 101
Partials 88 88
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for your contribution.
PR Details
This pr contains two commits, non-breaking change which fixes an issue and adds a function.
Description
For the first commit which open related issue DataValidation is unsafe when used in concurrent condition #1825 and has detail description about this. Use the mutex's method Lock() and Unlock() which is in the *File object.
Optimse code: Extract some code about xlsxDataValidation creation and keep the contents of the AddDataValidation function clean
And a new function named BatchAddDataValidation() to batch append data validation to the worksheet for some typical excel data validation template scenario.
Related Issue
#1825
#1826
Motivation and Context
How Has This Been Tested
There are some test cases already written in test file datavalidation_test.go and two testing functions: TestConcurrentAddDataValidation() for high concurrency and TestBatchAddDataValidation() to batch append data validation.
Types of changes
Checklist